Skip to content

Commit f9b4976

Browse files
feat(trusted publishing): initial commit to add release github action to support OIDC trusted publish
1 parent 97c9125 commit f9b4976

File tree

2 files changed

+96
-0
lines changed

2 files changed

+96
-0
lines changed

.github/workflows/release.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- next
8+
- testing-oidc-trusted-publishing
9+
pull_request:
10+
branches:
11+
- master
12+
13+
jobs:
14+
install_dependencies_and_setup_node_checkout:
15+
name: Configure github npm package registry for installing private @contentful packages, any public/non-contentful dependencies will be installed from npmjs.com
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v5
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v6
23+
with:
24+
node-version: '24'
25+
cache: 'npm'
26+
27+
- name: config npmrc
28+
- run: |
29+
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_PACKAGES_READ_TOKEN }}" > ~/.npmrc
30+
echo "@contentful:registry=https://npm.pkg.github.com" >> ~/.npmrc
31+
32+
- name: Install dependencies
33+
run: npm ci
34+
35+
36+
lint:
37+
name: Lint and Build
38+
runs-on: ubuntu-latest
39+
needs: install_dependencies
40+
steps:
41+
- name: Run linting
42+
run: npm run lint
43+
44+
- name: Check prettier formatting
45+
run: npm run prettier:check
46+
47+
- name: Build project
48+
run: npm run build
49+
50+
- name: Test bundle size
51+
run: npm run test:size
52+
53+
- name: Test TypeScript types
54+
run: npm run test:types
55+
56+
unit:
57+
name: Unit Tests
58+
runs-on: ubuntu-latest
59+
needs: install_dependencies
60+
steps:
61+
- name: Run unit tests
62+
run: npm run test:unit
63+
64+
integration:
65+
name: Integration Tests
66+
runs-on: ubuntu-latest
67+
needs: install_dependencies
68+
steps:
69+
- name: Run integration tests
70+
run: npm run test:integration
71+
72+
release:
73+
name: Release
74+
runs-on: ubuntu-latest
75+
needs: [lint, unit, integration, install_dependencies]
76+
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/next' || github.ref == 'refs/heads/testing-oidc-trusted-publishing')
77+
steps:
78+
- name: Setup Chrome
79+
uses: browser-actions/setup-chrome@v1
80+
81+
- name: Setup ChromeDriver
82+
uses: browser-actions/setup-chromedriver@v1
83+
84+
- name: Build project
85+
run: npm run build
86+
87+
- name: Run semantic release
88+
run: npm run semantic-release
89+
env:
90+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
91+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,11 @@
159159
"name": "next",
160160
"channel": "next",
161161
"prerelease": true
162+
},
163+
{
164+
"name": "testing-oidc-trusted-publishing",
165+
"channel": "testing-oidc-trusted-publishing",
166+
"prerelease": true
162167
}
163168
],
164169
"plugins": [

0 commit comments

Comments
 (0)