Release #10
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: Release | |
| on: | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| bump: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| bumped: ${{ steps.bump.outputs.bumped }} | |
| current-version: ${{ steps.bump.outputs.current-version }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Bump version | |
| id: bump | |
| uses: callowayproject/bump-my-version@master | |
| env: | |
| BUMPVERSION_TAG: "true" | |
| with: | |
| args: patch | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| changelog: | |
| runs-on: ubuntu-latest | |
| needs: bump | |
| outputs: | |
| changes: ${{ steps.changelog.outputs.changes }} | |
| if: needs.bump.outputs.bumped == 'true' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.ref_name }} | |
| - name: Update CHANGELOG | |
| id: changelog | |
| uses: requarks/changelog-action@v1 | |
| with: | |
| token: ${{ github.token }} | |
| tag: v${{ needs.bump.outputs.current-version }} | |
| continue-on-error: true | |
| - name: Commit CHANGELOG.md | |
| uses: stefanzweifel/git-auto-commit-action@v7 | |
| with: | |
| branch: main | |
| commit_message: 'docs: update CHANGELOG.md for ${{ github.ref_name }} [skip ci]' | |
| file_pattern: CHANGELOG.md | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: [bump, changelog] | |
| if: needs.bump.outputs.bumped == 'true' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.13 | |
| - name: Install poetry | |
| uses: abatilo/actions-poetry@v2 | |
| - name: Install dependencies | |
| run: | | |
| poetry install | |
| - name: Get dvc hash for examples directory | |
| run: | | |
| echo "DVC_HASH=$(poetry run python scripts/get_dvc_md5.py examples.dvc)" >> $GITHUB_ENV | |
| - name: Cache dvc directory | |
| uses: actions/cache@v4 | |
| with: | |
| path: .dvc | |
| key: ${{ runner.os }}-${{ env.DVC_HASH }} | |
| - name: Pull examples | |
| run: | | |
| poetry run dvc pull -v | |
| - name: Create archives | |
| run: | | |
| (cd examples && zip -r ../examples.zip .) | |
| (cd examples && tar -zcvf ../examples.tar.gz .) | |
| - name: Create release | |
| uses: ncipollo/release-action@v1.20.0 | |
| with: | |
| allowUpdates: true | |
| makeLatest: true | |
| tag: v${{ needs.bump.outputs.current-version }} | |
| name: 'Version ${{ needs.bump.outputs.current-version }} Release' | |
| body: ${{ needs.changelog.outputs.changes }} | |
| artifacts: "examples.tar.gz,examples.zip" |