Skip to content

Commit d12d252

Browse files
committed
chore: tweak release-please script
Signed-off-by: Gordon Smith <[email protected]>
1 parent d93d09e commit d12d252

File tree

4 files changed

+143
-54
lines changed

4 files changed

+143
-54
lines changed

.github/workflows/ci.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
on:
2+
pull_request:
3+
branches:
4+
- main
5+
- candidate-*
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
name: PR Testing
12+
13+
jobs:
14+
ci:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout Sources
18+
uses: actions/checkout@v4
19+
20+
- name: Install NodeJS
21+
uses: actions/setup-node@v6
22+
with:
23+
node-version: 22
24+
registry-url: "https://registry.npmjs.org"
25+
scope: "@hpcc-js"
26+
27+
- name: Install Dependencies
28+
run: |
29+
npm ci
30+
31+
- name: Lint
32+
run: |
33+
npm run lint
34+
35+
- name: Build
36+
run: |
37+
npm run build
38+
39+
- name: Install Test Dependencies
40+
run: |
41+
sudo apt-get update
42+
sudo npx -y playwright install chromium --with-deps
43+
npx -y playwright install chromium
44+
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
45+
46+
- name: Install HPCC Platform
47+
continue-on-error: true
48+
run: |
49+
sudo apt install -f ./hpccsystems-platform-community_9.6.50-1jammy_amd64_withsymbols.deb
50+
sudo /etc/init.d/hpcc-init start
51+
52+
- name: Test
53+
env:
54+
CI: true
55+
run: |
56+
npm run test
57+
npm run test-browser-esm
58+
npm run test-browser-umd
59+
npm run test-node-esm
60+
npm run test-node-cjs
61+
62+
- name: Upload error logs
63+
if: ${{ failure() || cancelled() }}
64+
uses: actions/upload-artifact@v4
65+
with:
66+
name: all-logs
67+
path: ./**/*.log
Lines changed: 76 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,57 @@
1-
name: PR Test and Release
2-
31
on:
42
push:
53
branches:
64
- main
75
- candidate-*
86

9-
pull_request:
10-
branches:
11-
- main
12-
- candidate-*
13-
147
permissions:
158
contents: write
169
pull-requests: write
10+
issues: write
11+
12+
name: release-please
1713

1814
jobs:
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
@@ -89,3 +74,40 @@ jobs:
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

Comments
 (0)