feat: add load and dump for serialization #143
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI/CD Pipeline | |
| on: [push, pull_request] | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: "3.4" | |
| bundler-cache: true | |
| - run: bundle exec rubocop | |
| steep: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: "3.4" | |
| bundler-cache: true | |
| - run: bundle exec rbs collection install | |
| - run: bundle exec rake steep | |
| test: | |
| strategy: | |
| matrix: | |
| ruby: ["3.2", "3.3", "3.4", "head"] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: ${{ matrix.ruby }} | |
| bundler-cache: true | |
| - run: bundle exec rake test | |
| release: | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Extract version from tag | |
| id: extract_version | |
| run: | | |
| echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | |
| echo "version_number=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
| - name: Extract changelog entry | |
| id: changelog | |
| run: | | |
| VERSION_NUMBER="${{ steps.extract_version.outputs.version_number }}" | |
| # Extract the changelog entry for this version | |
| awk "/^## \[$VERSION_NUMBER\]/{flag=1;next}/^## \[/{flag=0}flag" CHANGELOG.md > release_notes.md | |
| # Check if we found content | |
| if [ -s release_notes.md ]; then | |
| echo "Found changelog entry for version $VERSION_NUMBER" | |
| else | |
| echo "No specific changelog entry found, using default" | |
| echo "Release ${{ steps.extract_version.outputs.version }}" > release_notes.md | |
| fi | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.extract_version.outputs.version }} | |
| name: ${{ steps.extract_version.outputs.version }} | |
| body_path: release_notes.md | |
| draft: false | |
| prerelease: false |