|
| 1 | +# This file is @generated by <https://github.com/liblaf/copier-release>. |
| 2 | +# DO NOT EDIT! |
| 3 | + |
| 4 | +name: Release Please |
| 5 | + |
| 6 | +on: |
| 7 | + push: |
| 8 | + branches: |
| 9 | + - main |
| 10 | + |
| 11 | +jobs: |
| 12 | + release-please: |
| 13 | + name: Release Please |
| 14 | + permissions: |
| 15 | + contents: write |
| 16 | + pull-requests: write |
| 17 | + runs-on: ubuntu-latest |
| 18 | + environment: |
| 19 | + name: Release Please |
| 20 | + outputs: |
| 21 | + pr: ${{ steps.release-please.outputs.pr }} |
| 22 | + prs_created: ${{ steps.release-please.outputs.prs_created }} |
| 23 | + release_created: ${{ steps.release-please.outputs.release_created }} |
| 24 | + tag: ${{ steps.release-please.outputs.tag_name }} |
| 25 | + steps: |
| 26 | + - id: auth |
| 27 | + name: Auth |
| 28 | + uses: liblaf/actions/auth@dist |
| 29 | + with: |
| 30 | + app-id: ${{ vars.APP_ID }} |
| 31 | + private-key: ${{ secrets.PRIVATE_KEY }} |
| 32 | + - name: Checkout |
| 33 | + uses: actions/checkout@v5 |
| 34 | + with: |
| 35 | + token: ${{ steps.auth.outputs.token }} |
| 36 | + - id: release-please |
| 37 | + name: Release Please |
| 38 | + uses: googleapis/release-please-action@v4 |
| 39 | + with: |
| 40 | + token: ${{ steps.auth.outputs.token }} |
| 41 | + config-file: .config/release-please/config.json |
| 42 | + manifest-file: .config/release-please/.manifest.json |
| 43 | + |
| 44 | + post-pr: |
| 45 | + name: Post PR |
| 46 | + permissions: |
| 47 | + contents: write |
| 48 | + pull-requests: write |
| 49 | + needs: |
| 50 | + - release-please |
| 51 | + if: ${{ needs.release-please.outputs.pr }} |
| 52 | + runs-on: ubuntu-latest |
| 53 | + environment: |
| 54 | + name: Release Please |
| 55 | + steps: |
| 56 | + - id: auth |
| 57 | + name: Auth |
| 58 | + uses: liblaf/actions/auth@dist |
| 59 | + with: |
| 60 | + app-id: ${{ vars.APP_ID }} |
| 61 | + private-key: ${{ secrets.PRIVATE_KEY }} |
| 62 | + - name: Checkout |
| 63 | + uses: actions/checkout@v5 |
| 64 | + with: |
| 65 | + ref: ${{ fromJson(needs.release-please.outputs.pr).headBranchName }} |
| 66 | + token: ${{ steps.auth.outputs.token }} |
| 67 | + fetch-depth: 0 |
| 68 | + - id: tag |
| 69 | + name: Get Tag |
| 70 | + run: |- |
| 71 | + title='${{ fromJson(needs.release-please.outputs.pr).title }}' |
| 72 | + version="$(awk '{ print $NF }' <<< "$title")" |
| 73 | + printf 'tag=%s\n' "v$version" >> "$GITHUB_OUTPUT" |
| 74 | + - name: Changelog |
| 75 | + uses: liblaf/actions/changelog@dist |
| 76 | + with: |
| 77 | + output: CHANGELOG.md |
| 78 | + args: --tag '${{ steps.tag.outputs.tag }}' |
| 79 | + - id: message |
| 80 | + name: Get Commit Message |
| 81 | + run: |- |
| 82 | + delimiter="$(uuidgen)" |
| 83 | + message="$(git show --format='%B' --no-patch)" |
| 84 | + printf 'message<<%s\n%s\n%s\n' "$delimiter" "$message" "$delimiter" >> "$GITHUB_OUTPUT" |
| 85 | + - name: Undo Last Commit |
| 86 | + run: git reset --soft HEAD~1 |
| 87 | + - name: Commit |
| 88 | + uses: liblaf/actions/commit@dist |
| 89 | + with: |
| 90 | + add-options: --verbose 'CHANGELOG.md' |
| 91 | + force: true |
| 92 | + message: ${{ steps.message.outputs.message }} |
| 93 | + ref: ${{ fromJson(needs.release-please.outputs.pr).headBranchName }} |
| 94 | + token: ${{ steps.auth.outputs.token }} |
| 95 | + - name: Add Label |
| 96 | + run: |- |
| 97 | + gh pr edit '${{ fromJson(needs.release-please.outputs.pr).number }}' --add-label 'automerge' |
| 98 | + env: |
| 99 | + GH_TOKEN: ${{ steps.auth.outputs.token }} |
| 100 | +
|
| 101 | + post-release: |
| 102 | + name: Post Release |
| 103 | + permissions: |
| 104 | + contents: write |
| 105 | + needs: |
| 106 | + - release-please |
| 107 | + if: ${{ needs.release-please.outputs.release_created }} |
| 108 | + runs-on: ubuntu-latest |
| 109 | + environment: |
| 110 | + name: Release Please |
| 111 | + steps: |
| 112 | + - id: auth |
| 113 | + name: Auth |
| 114 | + uses: liblaf/actions/auth@dist |
| 115 | + with: |
| 116 | + app-id: ${{ vars.APP_ID }} |
| 117 | + private-key: ${{ secrets.PRIVATE_KEY }} |
| 118 | + - name: Checkout |
| 119 | + uses: actions/checkout@v5 |
| 120 | + with: |
| 121 | + ref: ${{ needs.release-please.outputs.tag }} |
| 122 | + token: ${{ steps.auth.outputs.token }} |
| 123 | + fetch-depth: 0 |
| 124 | + - id: changelog |
| 125 | + name: Changelog |
| 126 | + uses: liblaf/actions/changelog@dist |
| 127 | + with: |
| 128 | + args: --current --strip all |
| 129 | + - name: Update Release Notes |
| 130 | + run: >- |
| 131 | + gh release edit '${{ needs.release-please.outputs.tag }}' |
| 132 | + --notes-file '${{ steps.changelog.outputs.changelog }}' |
| 133 | + env: |
| 134 | + GH_TOKEN: ${{ steps.auth.outputs.token }} |
0 commit comments