GITHUB_TOKEN cannot trigger push:tags workflows, so Release never ran after release-please. Dispatch release.yml explicitly when a release is created. Add workflow_dispatch to Tests for on-demand main verification.
42 lines
1.3 KiB
YAML
42 lines
1.3 KiB
YAML
name: Release Please
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
issues: write
|
|
actions: write
|
|
|
|
jobs:
|
|
release-please:
|
|
name: Release Please
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Run release-please
|
|
uses: googleapis/release-please-action@v4
|
|
id: release
|
|
with:
|
|
config-file: release-please-config.json
|
|
manifest-file: .release-please-manifest.json
|
|
token: ${{ secrets.RELEASE_PLEASE_TOKEN != '' && secrets.RELEASE_PLEASE_TOKEN || secrets.GITHUB_TOKEN }}
|
|
|
|
# Tags/releases created with GITHUB_TOKEN do not trigger other workflows
|
|
# (push:tags on Release.yml never fires). Dispatch GoReleaser explicitly.
|
|
- name: Trigger GoReleaser
|
|
if: ${{ steps.release.outputs.release_created == 'true' }}
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
TAG: ${{ steps.release.outputs.tag_name }}
|
|
run: |
|
|
set -euo pipefail
|
|
echo "Dispatching Release workflow for $TAG"
|
|
gh workflow run release.yml --repo "${{ github.repository }}" -f "tag=${TAG}"
|
|
|
|
outputs:
|
|
release_created: ${{ steps.release.outputs.release_created }}
|
|
tag_name: ${{ steps.release.outputs.tag_name }}
|