Merge pull request #21 from Mogyuchi/release-please #1
This file contains 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: | |
push: | |
branches: main | |
jobs: | |
release-please: | |
permissions: | |
contents: write | |
pull-requests: write | |
runs-on: ubuntu-latest | |
outputs: | |
release_created: ${{ steps.release-please.outputs.release_created }} | |
tag_name: ${{ steps.release-please.outputs.tag_name }} | |
pr: ${{ steps.release-please.outputs.pr }} | |
steps: | |
- uses: google-github-actions/release-please-action@a2d8d683f209466ee8c695cd994ae2cf08b1642d # v4.0.1 | |
id: release-please | |
with: | |
config-file: .github/.config/release-please-config.json | |
manifest-file: .release-please-manifest.json | |
docker-publish: | |
needs: release-please | |
if: ${{ needs.release-please.outputs.release_created }} | |
permissions: | |
contents: write | |
packages: write | |
uses: ./.github/workflows/docker-publish.yml | |
with: | |
tag-name: ${{ needs.release-please.outputs.tag_name }} | |
label-published: | |
needs: [release-please, docker-publish] | |
if: ${{ needs.release-please.outputs.release_created }} | |
permissions: | |
pull-requests: write | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GH_REPO: ${{ github.repository }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Create published label | |
run: | | |
gh label create 'autorelease: published' --color=EDEDED || true | |
- name: Get PR number | |
id: pr-number | |
run: | | |
echo "pr_number=$(printf '${{ github.event.head_commit.message }}' | head -n1 | sed -nE 's/.+\(#([0-9]+)\)$/\1/p')" >> "$GITHUB_OUTPUT" | |
- name: Change labels on PR | |
run: | | |
gh pr edit ${{ steps.pr-number.outputs.pr_number }} \ | |
--remove-label='autorelease: tagged' \ | |
--add-label='autorelease: published' |