Skip to content

Commit 8eb60ba

Browse files
chore: Update GitHub Actions workflows for pull request CI and npm publishing
1 parent d2740a2 commit 8eb60ba

File tree

3 files changed

+54
-5
lines changed

3 files changed

+54
-5
lines changed

.github/workflows/publish.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Test and publish to npm
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build-and-test:
8+
uses: ./.github/workflows/test-publish.yml
9+
10+
publish:
11+
needs:
12+
- test-cdk-basic
13+
- test-sls-basic
14+
- test-sls-esbuild-cjs
15+
- test-sls-esbuild-esm
16+
- test-sam-basic
17+
- test-terraform-basic
18+
if: github.event_name == 'workflow_dispatch'
19+
runs-on: ubuntu-latest
20+
concurrency:
21+
group: publish
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: Use Node.js
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: "20"
28+
registry-url: "https://registry.npmjs.org"
29+
- name: Install dependencies
30+
run: npm ci
31+
- uses: actions/download-artifact@v4
32+
with:
33+
name: dist
34+
path: dist
35+
- name: Semantic Release
36+
run: |
37+
npm whoami
38+
npx semantic-release
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.PRIVATE_GITHUB_TOKEN }}
41+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
42+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/pull-request.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: Pull Request CI
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build-and-test:
10+
uses: ./.github/workflows/test-publish.yml
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
name: Deploy to npm
1+
name: Test and publish to npm
22

33
on:
4-
pull_request:
5-
branches:
6-
- main
7-
workflow_dispatch:
4+
workflow_call:
85

96
permissions:
107
id-token: write

0 commit comments

Comments
 (0)