Skip to content

Commit fb03052

Browse files
authored
ci: upgrade release workflow (npm OIDC auth), Node LTS, semantic-release, actions, mparticle/web-sdk (#53)
1 parent 8143b92 commit fb03052

File tree

5 files changed

+7130
-15412
lines changed

5 files changed

+7130
-15412
lines changed

.github/workflows/pull-request.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ jobs:
1111

1212
strategy:
1313
matrix:
14-
node-version: [18.x, 20.x]
14+
node-version: [18.x, 20.x, 22.x, 24.x]
1515

1616
steps:
1717
- name: Checkout
18-
uses: actions/checkout@v3
18+
uses: actions/checkout@v4
1919

2020
- name: Use Node.js ${{ matrix.node-version }}
21-
uses: actions/setup-node@v3
21+
uses: actions/setup-node@v4
2222
with:
2323
node-version: ${{ matrix.node-version }}
2424

@@ -32,7 +32,7 @@ jobs:
3232
run: npm run test
3333

3434
- name: Archive npm failure logs
35-
uses: actions/upload-artifact@v3
35+
uses: actions/upload-artifact@v4
3636
if: failure()
3737
with:
3838
name: npm-logs

.github/workflows/release.yml

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ jobs:
2020
needs: confirm-public-repo-master-branch
2121
steps:
2222
- name: Checkout
23-
uses: actions/checkout@v3
23+
uses: actions/checkout@v4
2424

2525
- name: NPM install
26-
uses: actions/setup-node@v3
26+
uses: actions/setup-node@v4
2727
with:
28-
node-version: 18.x
28+
node-version: 24.x
2929

3030
- name: Run NPM CI
3131
run: npm ci
@@ -37,7 +37,7 @@ jobs:
3737
run: npm run test
3838

3939
- name: Archive npm failure logs
40-
uses: actions/upload-artifact@v3
40+
uses: actions/upload-artifact@v4
4141
if: failure()
4242
with:
4343
name: npm-logs
@@ -51,7 +51,7 @@ jobs:
5151
- confirm-public-repo-master-branch
5252
steps:
5353
- name: Checkout development branch
54-
uses: actions/checkout@v3
54+
uses: actions/checkout@v4
5555
with:
5656
repository: mparticle-integrations/mparticle-javascript-integration-mixpanel
5757
ref: development
@@ -67,17 +67,24 @@ jobs:
6767
- build-and-test
6868
- create-release-branch
6969
- confirm-public-repo-master-branch
70+
71+
# OIDC permissions for npm trusted publishing
72+
permissions:
73+
contents: write
74+
issues: write
75+
pull-requests: write
76+
id-token: write # Required for OIDC authentication with npm
77+
7078
env:
7179
GITHUB_TOKEN: ${{ secrets.MP_INTEGRATIONS_SEMANTIC_RELEASE_BOT }}
7280
GIT_AUTHOR_NAME: mparticle-automation
7381
GIT_AUTHOR_EMAIL: developers@mparticle.com
7482
GIT_COMMITTER_NAME: mparticle-automation
7583
GIT_COMMITTER_EMAIL: developers@mparticle.com
76-
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
7784

7885
steps:
7986
- name: Checkout public master branch
80-
uses: actions/checkout@v3
87+
uses: actions/checkout@v4
8188
with:
8289
fetch-depth: 0
8390
ref: master
@@ -94,13 +101,17 @@ jobs:
94101
run: |
95102
git pull origin release/${{ github.run_number }}
96103
- name: Setup Node.js
97-
uses: actions/setup-node@v3
104+
uses: actions/setup-node@v4
98105
with:
99-
node-version: 16.x
106+
node-version: 24.x
107+
registry-url: 'https://registry.npmjs.org'
100108

101109
- name: Install dependencies
102110
run: npm ci
103111

112+
- name: Ensure npm CLI supports OIDC
113+
run: npm install -g npm@latest
114+
104115
- name: Release --dry-run
105116
if: ${{ github.event.inputs.dryRun == 'true'}}
106117
run: |
@@ -110,7 +121,7 @@ jobs:
110121
run: |
111122
npx semantic-release
112123
- name: Archive npm failure logs
113-
uses: actions/upload-artifact@v3
124+
uses: actions/upload-artifact@v4
114125
if: failure()
115126
with:
116127
name: npm-logs
@@ -126,7 +137,7 @@ jobs:
126137
runs-on: ubuntu-latest
127138
steps:
128139
- name: Checkout master branch
129-
uses: actions/checkout@v3
140+
uses: actions/checkout@v4
130141
with:
131142
fetch-depth: 0
132143
repository: ${{ github.repository }}

0 commit comments

Comments
 (0)