1- name : PR Test and Release
2-
31on :
42 push :
53 branches :
64 - main
75 - candidate-*
86
9- pull_request :
10- branches :
11- - main
12- - candidate-*
13-
147permissions :
158 contents : write
169 pull-requests : write
10+ issues : write
11+
12+ name : release-please
1713
1814jobs :
1915 release-please :
2016 runs-on : ubuntu-latest
17+ outputs :
18+ release_created : ${{ steps.release.outputs.release_created }}
19+ tag_name : ${{ steps.release.outputs.tag_name }}
20+ version : ${{ steps.release.outputs.version }}
2121 steps :
22- - name : Checkout Sources
23- uses : actions/checkout@v4
24-
25- - name : Initialize Release Please
26- id : release
22+ - id : release
2723 uses : googleapis/release-please-action@v4
2824 with :
2925 token : ${{ secrets.GITHUB_TOKEN }}
30- target-branch : ${{ github.ref_name }}
31- config-file : release-please-config.json
32- manifest-file : .release-please-manifest.json
26+ config-file : .github/release-please-config.json
27+ manifest-file : .github/release-please-manifest.json
28+
29+ publish :
30+ needs : [release-please]
31+ if : ${{ needs.release-please.outputs.release_created == 'true' }}
32+ runs-on : ubuntu-latest
33+ permissions :
34+ contents : write
35+ outputs :
36+ release_name : ${{ steps.event_details.outputs.release_name }}
37+ tag_name : ${{ steps.event_details.outputs.tag_name }}
38+ version : ${{ steps.event_details.outputs.version }}
39+
40+ steps :
41+ - name : Check event details
42+ id : event_details
43+ env :
44+ RELEASE_NAME : ${{ needs.release-please.outputs.tag_name }}
45+ TAG_NAME : ${{ needs.release-please.outputs.tag_name }}
46+ run : |
47+ echo "release_name=${RELEASE_NAME}" >> $GITHUB_OUTPUT
48+ echo "tag_name=${TAG_NAME}" >> $GITHUB_OUTPUT
49+ echo "version=${TAG_NAME##*-v}" >> $GITHUB_OUTPUT
50+ echo "package_name=${RELEASE_NAME%:*}" >> $GITHUB_OUTPUT
51+
52+ - uses : actions/checkout@v4
53+ with :
54+ ref : ${{ steps.event_details.outputs.tag_name }}
3355
3456 - name : Install NodeJS
3557 uses : actions/setup-node@v6
@@ -38,49 +60,12 @@ jobs:
3860 registry-url : " https://registry.npmjs.org"
3961 scope : " @hpcc-js"
4062
41- - name : Install Dependencies
42- run : |
43- npm ci
44-
45- - name : Lint
46- run : |
47- npm run lint
48-
4963 - name : Build
50- run : |
51- npm run build
52-
53- - name : Install Test Dependencies
54- if : ${{ github.event_name == 'pull_request' }}
55- run : |
56- sudo apt-get update
57- sudo npx -y playwright install chromium --with-deps
58- npx -y playwright install chromium
59- wget https://github.com/hpcc-systems/HPCC-Platform/releases/download/community_9.6.50-1/hpccsystems-platform-community_9.6.50-1jammy_amd64_withsymbols.deb
60-
61- - name : Install HPCC Platform
62- if : ${{ github.event_name == 'pull_request' }}
63- continue-on-error : true
64- run : |
65- sudo apt install -f ./hpccsystems-platform-community_9.6.50-1jammy_amd64_withsymbols.deb
66- sudo /etc/init.d/hpcc-init start
67-
68- - name : Test
69- if : ${{ github.event_name == 'pull_request' }}
70- env :
71- CI : true
72- run : |
73- npm run test
74- npm run test-browser-esm
75- npm run test-browser-umd
76- npm run test-node-esm
77- npm run test-node-cjs
78-
79- - name : Publish
80- if : ${{ steps.release.outputs.release_created }}
8164 env :
8265 NODE_AUTH_TOKEN : ${{secrets.NPM_TOKEN}}
8366 run : |
67+ npm ci
68+ npm run build
8469 npm run publish
8570
8671 - name : Upload error logs
8974 with :
9075 name : all-logs
9176 path : ./**/*.log
77+
78+ label :
79+ needs : [publish]
80+ runs-on : ubuntu-latest
81+ permissions :
82+ contents : read
83+ issues : write
84+ pull-requests : write
85+ repository-projects : read
86+ steps :
87+ - uses : actions/checkout@v4
88+ - name : Add label to PR
89+ env :
90+ GITHUB_TOKEN : ${{ github.token }}
91+ run : |
92+ PR_NUMBER=$(gh pr list --state merged --label 'autorelease: tagged' --json number --jq '.[0].number')
93+ gh pr edit ${PR_NUMBER} --add-label 'autorelease: published'
94+
95+ comments :
96+ needs : [publish]
97+ runs-on : ubuntu-latest
98+ permissions :
99+ contents : write
100+ issues : write
101+ pull-requests : write
102+ steps :
103+ - uses : apexskier/github-release-commenter@v1
104+ with :
105+ GITHUB_TOKEN : ${{ github.token }}
106+ comment-template : |
107+ :tada: This change has been included in ${{ needs.publish.outputs.tag_name }} :tada:
108+
109+ The release is available on:
110+ - GitHub releases: {release_link}
111+ - Node Package Manager: https://www.npmjs.com/search?q=%40hpcc-js
112+
113+ Your **[release-please](https://github.com/googleapis/release-please)** bot :rocket::pray:
0 commit comments