@@ -3,92 +3,11 @@ name: 'release'
33on :
44 push :
55 branches :
6- - ' main'
7- workflow_dispatch :
6+ - ' main'
7+ - ' release/**/* '
88
99jobs :
10- # build compiles the code and creates a pull request of the compiled result if
11- # there is a diff.
12- build :
13- runs-on : ' ubuntu-latest'
14- steps :
15- - uses : ' actions/checkout@v3'
16-
17- - uses : ' actions/setup-node@v3'
18- with :
19- node-version : ' 16.x'
20-
21- - name : ' npm build'
22- run : ' npm ci && npm run build'
23-
24- - name : ' Create pull request'
25- uses : ' peter-evans/create-pull-request@dcd5fd746d53dd8de555c0f10bca6c35628be47a'
26- with :
27- token : ' ${{ secrets.ACTIONS_BOT_TOKEN }}'
28- add-paths : ' dist/'
29- committer : ' google-github-actions-bot <github-actions-bot@google.com>'
30- author : ' google-github-actions-bot <github-actions-bot@google.com>'
31- signoff : ' google-github-actions-bot <github-actions-bot@google.com>'
32- commit-message : ' Build dist'
33- title : ' chore: build dist'
34- body : ' Build compiled Typescript'
35- base : ' main'
36- branch : ' actions/build'
37- push-to-fork : ' google-github-actions-bot/deploy-cloud-functions'
38- delete-branch : true
39-
40- # create-pull-request creates a release pull request if there are any
41- # convential commit changes since the last release.
42- create-pull-request :
43- runs-on : ' ubuntu-latest'
44- steps :
45- - uses : ' google-github-actions/release-please-action@v2'
46- with :
47- token : ' ${{ secrets.ACTIONS_BOT_TOKEN }}'
48- release-type : ' node'
49- bump-minor-pre-major : true
50- command : ' release-pr'
51- fork : true
52-
53- # release does a release on the merge of the release pull request. It also
54- # updates the floating tag alias for the major version.
5510 release :
56- runs-on : ' ubuntu-latest'
57- steps :
58- - id : ' release'
59- uses : ' google-github-actions/release-please-action@v2'
60- with :
61- release-type : ' node'
62- bump-minor-pre-major : true
63- command : ' github-release'
64-
65- - name : ' Update floating tag'
66- if : ' ${{ steps.release.outputs.release_created }}'
67- uses : ' actions/github-script@v5'
68- with :
69- script : |-
70- const sha = '${{ steps.release.outputs.sha }}'
71- const major = 'v${{ steps.release.outputs.major }}';
72-
73- // Try to update the ref first. If that fails, it probably does not
74- // exist yet, and we should create it.
75- try {
76- await github.rest.git.updateRef({
77- owner: context.repo.owner,
78- repo: context.repo.repo,
79- ref: `tags/${major}`,
80- sha: sha,
81- force: true,
82- });
83- core.info(`Updated ${major} to ${sha}`);
84- } catch(err) {
85- core.warning(`Failed to create ${major}: ${err}`);
86-
87- await github.rest.git.createRef({
88- owner: context.repo.owner,
89- repo: context.repo.repo,
90- ref: `refs/tags/${major}`,
91- sha: sha,
92- });
93- core.info(`Created ${major} at ${sha}`);
94- }
11+ if : " startsWith(github.event.head_commit.message, 'Release: v')"
12+ name : ' Release'
13+ uses : ' google-github-actions/.github/.github/workflows/release.yml@v0'
0 commit comments