1- name : release-please
1+ name : Release Please
22
33on :
4- push :
5- branches :
6- - main
4+ workflow_call :
5+ secrets :
6+ application-id :
7+ required : true
8+ private-key :
9+ required : true
710
811permissions :
912 contents : write
1013 pull-requests : write
1114
12- concurrency :
13- group : release-please
14- cancel-in-progress : false
15-
1615jobs :
17- setup-release-context :
18- runs-on : ubuntu-latest
19- outputs :
20- packages : ${{ steps.check-files.outputs.packages }}
21- prev_sha : ${{ steps.check-files.outputs.prev_sha }}
22- steps :
23- - uses : actions/checkout@v4
24- with :
25- fetch-depth : 2
26- - name : Get list of workflows with changes
27- id : check-files
28- run : |
29- # Get list of workflows
30- workflow_list=($(basename -a -s .yml $(find .github/workflows/ -type f -print | xargs -I{} grep -l "workflow_call:$" {})))
31- # Get list of workflows to release
32- workflow_with_changes=$(printf "/%s[./]\n" ${workflow_list[@]} | xargs -I{} sh -c "git diff --name-only ${{ github.sha }} ${{ github.sha }}^ | grep -om1 -e '{}' || true" | tr -d /.)
33- releases_with_changes=$(printf "^%s[./]\n" ${workflow_list[@]} | xargs -I{} sh -c "git diff --name-only ${{ github.sha }} ${{ github.sha }}^ | grep -om1 -e '{}' || true" | tr -d /.)
34- # Set list of workflows to release
35- echo "packages=$(jq -cn --args '$ARGS.positional' -- ${workflow_with_changes[@]} ${releases_with_changes[@]})" >> "$GITHUB_OUTPUT"
36- echo "prev_sha=$(git rev-parse ${{ github.sha }}^)" >> "$GITHUB_OUTPUT"
37- shell : bash
38-
3916 release-please :
40- needs : setup-release-context
41- if : ${{ needs.setup-release-context.outputs.packages != '[]' }}
4217 runs-on : ubuntu-latest
43- strategy :
44- fail-fast : false
45- matrix :
46- package : ${{ fromJSON(needs.setup-release-context.outputs.packages) }}
4718 steps :
48- - uses : googleapis/release-please-action@v3
49- id : release
19+ - name : Get Token
20+ id : get_token
21+ uses : peter-murray/workflow-application-token-action@v3
22+ with :
23+ application_id : " ${{ secrets.release-please-application-id }}"
24+ application_private_key : ${{ secrets.release-please-private-key }}
25+ organization : ${{ github.repository_owner }}
26+ - name : Run release-please
27+ uses : googleapis/release-please-action@v4
5028 with :
51- default-branch : main
52- token : ${{ secrets.RELEASE_PLEASE_TOKEN }}
53- release-type : simple
54- package-name : ${{ matrix.package }}
55- version-file : ${{ matrix.package }}/version.txt
56- changelog-path : ${{ matrix.package }}/CHANGELOG.md
57- last-release-sha : ${{ needs.setup-release-context.outputs.prev_sha }}
58- labels : ${{ matrix.package }}
59- bump-patch-for-minor-pre-major : true
60- bump-minor-pre-major : true
61- monorepo-tags : true
62- release-as : " "
29+ token : ${{ steps.get_token.outputs.token }}
0 commit comments