Skip to content

chore(copier): update from template #8

chore(copier): update from template

chore(copier): update from template #8

# This file is @generated by <https://github.com/liblaf/copier-release>.
# DO NOT EDIT!
name: (Shared) Release Please
on:
push:
branches:
- main
workflow_dispatch:
jobs:
release-please:
name: Release Please
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-release-please
cancel-in-progress: true
outputs:
created: ${{ steps.release-please.outputs.release_created }}
pr: ${{ steps.release-please.outputs.pr }}
tag: ${{ steps.release-please.outputs.tag_name }}
steps:
- id: release-please
name: Release Please
uses: googleapis/release-please-action@v4
with:
config-file: .github/release-please/config.json
manifest-file: .github/release-please/.manifest.json
token: ${{ github.token }}
changelog-pr:
name: Changelog (PR)
permissions:
contents: write
needs:
- release-please
if: ${{ needs.release-please.outputs.pr }}
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-changelog-pr
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ fromJson(needs.release-please.outputs.pr).headBranchName }}
token: ${{ github.token }}
fetch-depth: 0
- id: tag
name: Parse Tag
run: |-
title="${{ fromJson(needs.release-please.outputs.pr).title }}"
version=$(echo "$title" | awk '{ print $NF }')
echo "tag=v$version" >> "$GITHUB_OUTPUT"
- name: Changelog
uses: liblaf/actions/changelog@main
with:
args: --tag "${{ steps.tag.outputs.tag }}"
output: CHANGELOG.md
- name: Commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore(docs): update CHANGELOG.md"
file_pattern: CHANGELOG.md
changelog-release:
name: Changelog (Release)
permissions:
actions: write
contents: write
needs:
- release-please
if: ${{ needs.release-please.outputs.created }}
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-changelog-release
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ needs.release-please.outputs.tag }}
fetch-depth: 0
- id: changelog
name: Changelog
uses: liblaf/actions/changelog@main
with:
args: --current --strip all
- name: Update Release
run: gh release edit "${{ needs.release-please.outputs.tag }}" --notes-file "${{ steps.changelog.outputs.changelog }}"
env:
GH_TOKEN: ${{ github.token }}
- name: Trigger Release Workflow
run: |-
WORKFLOW_FILES=(.github/workflows/{,shared-}release{.yaml,.yml})
for workflow_file in "${WORKFLOW_FILES[@]}"; do
if [[ -f $workflow_file ]]; then
workflow_name=$(basename -- "$workflow_file")
echo "::notice::Triggering workflow: $workflow_name"
gh workflow run "$workflow_name" --ref "${{ needs.release-please.outputs.tag }}"
fi
done
env:
GH_TOKEN: ${{ github.token }}