ci: release only on real changes (feat/fix/perf) and add Glama emoji … #88
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: read | |
| jobs: | |
| release-please: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # release commits and tags | |
| pull-requests: write # the release PR | |
| # Needed so this workflow can dispatch publish.yml and docker.yml after | |
| # release-please creates the release. workflow_dispatch is the documented | |
| # exception that lets a GITHUB_TOKEN-driven workflow start downstream | |
| # workflows — without it the release: published event is suppressed and | |
| # PyPI / GHCR never see the new version. | |
| actions: write | |
| steps: | |
| - id: release | |
| uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| config-file: release-please-config.json | |
| manifest-file: .release-please-manifest.json | |
| # Whenever a release was created, fan out to the workflows that publish | |
| # the artifacts. We use workflow_dispatch (rather than relying on the | |
| # native release: published trigger) because release-please runs under | |
| # GITHUB_TOKEN and GitHub deliberately suppresses cascade triggers from | |
| # GITHUB_TOKEN-authored events. | |
| # docs: https://docs.github.com/en/actions/security-guides/automatic-token-authentication | |
| - name: Dispatch PyPI publish | |
| if: ${{ steps.release.outputs.release_created }} | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh workflow run publish.yml \ | |
| --repo "$GITHUB_REPOSITORY" \ | |
| --ref "${{ steps.release.outputs.tag_name }}" \ | |
| --field tag="${{ steps.release.outputs.tag_name }}" | |
| - name: Dispatch Docker image build | |
| if: ${{ steps.release.outputs.release_created }} | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh workflow run docker.yml \ | |
| --repo "$GITHUB_REPOSITORY" \ | |
| --ref "${{ steps.release.outputs.tag_name }}" \ | |
| --field tag="${{ steps.release.outputs.tag_name }}" |