feat: add fix-release workflow for handling failed releases - Created… #16
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 Please | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| packages: write | |
| actions: write | |
| id-token: write | |
| issues: write | |
| jobs: | |
| release-please: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| release_created: ${{ steps.release.outputs.release_created }} | |
| tag_name: ${{ steps.release.outputs.tag_name }} | |
| steps: | |
| - uses: googleapis/release-please-action@v4 | |
| id: release | |
| with: | |
| config-file: .release-please-config.json | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| publish-package: | |
| needs: release-please | |
| if: ${{ needs.release-please.outputs.release_created }} | |
| runs-on: ubuntu-latest | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-tags: true | |
| - uses: asdf-vm/actions/install@v4 | |
| - name: Publish package to PyPI | |
| run: make publish-package | |
| publish-image: | |
| needs: release-please | |
| if: ${{ needs.release-please.outputs.release_created }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| arch: [linux/amd64, linux/arm64] | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - run: git fetch --tags origin | |
| - run: git checkout ${{ needs.release-please.outputs.tag_name }} | |
| - uses: docker/setup-qemu-action@v3 | |
| - uses: docker/setup-buildx-action@v3 | |
| - name: Publish container image | |
| run: make publish-image | |
| env: | |
| DOCKER_DEFAULT_PLATFORM: ${{ matrix.arch }} |