Skip to content

Commit 048df91

Browse files
committed
Move publishing out into separate workflow file
1 parent b923a98 commit 048df91

2 files changed

Lines changed: 53 additions & 48 deletions

File tree

.github/workflows/authzed-node.yaml

Lines changed: 1 addition & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: authzed-node-ci
1+
name: "Lint and Test"
22
on:
33
push:
44
branches:
@@ -9,8 +9,6 @@ on:
99
merge_group:
1010
types:
1111
- "checks_requested"
12-
release:
13-
types: [published]
1412
jobs:
1513
paths-filter:
1614
runs-on: "buildjet-2vcpu-ubuntu-2204"
@@ -55,28 +53,6 @@ jobs:
5553
- name: Run Yarn tests
5654
run: CI=true yarn only-run-tests
5755
working-directory: ./
58-
publish-npm:
59-
name: Publish to NPM
60-
needs:
61-
- test
62-
runs-on: ubuntu-latest
63-
if: github.event_name == 'release'
64-
steps:
65-
- uses: actions/checkout@v4
66-
- uses: actions/setup-node@v4
67-
with:
68-
node-version: 18
69-
- uses: bahmutov/npm-install@v1
70-
with:
71-
install-command: yarn --frozen-lockfile --silent
72-
working-directory: ./
73-
- run: yarn test
74-
- uses: battila7/get-version-action@v2
75-
- uses: JS-DevTools/npm-publish@v3
76-
with:
77-
token: ${{ secrets.NPM_TOKEN }}
78-
tag: ${{ steps.get_version.outputs.version }}
79-
access: public
8056
build-js-client:
8157
name: Build and Test JS client
8258
runs-on: "buildjet-2vcpu-ubuntu-2204"
@@ -114,26 +90,3 @@ jobs:
11490
path: |
11591
js-dist/**
11692
!js-dist/node_modules/**
117-
publish-js-client-npm:
118-
name: Publish JS client to NPM
119-
needs: build-js-client
120-
runs-on: ubuntu-latest
121-
if: github.event_name == 'release'
122-
steps:
123-
- name: Download js client build
124-
uses: actions/download-artifact@v4
125-
with:
126-
name: js-client-18
127-
- uses: actions/setup-node@v4
128-
with:
129-
node-version: 18
130-
- uses: bahmutov/npm-install@v1
131-
with:
132-
install-command: yarn --frozen-lockfile --silent
133-
working-directory: ./
134-
- uses: battila7/get-version-action@v2
135-
- uses: JS-DevTools/npm-publish@v3
136-
with:
137-
token: ${{ secrets.NPM_TOKEN }}
138-
tag: ${{ steps.get_version.outputs.version }}
139-
access: public

.github/workflows/publish.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
# yamllint disable rule:line-length
3+
name: "Publish to NPM"
4+
on: # yamllint disable-line rule:truthy
5+
release:
6+
types:
7+
- "published"
8+
jobs:
9+
publish:
10+
name: Publish to NPM
11+
needs:
12+
- test
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: 18
19+
- uses: bahmutov/npm-install@v1
20+
with:
21+
install-command: yarn --frozen-lockfile --silent
22+
working-directory: ./
23+
- run: yarn test
24+
- uses: battila7/get-version-action@v2
25+
- uses: JS-DevTools/npm-publish@v3
26+
with:
27+
token: ${{ secrets.NPM_TOKEN }}
28+
tag: ${{ steps.get_version.outputs.version }}
29+
access: public
30+
# NOTE: this publishes an alternate version that doesn't depend on protobuf-ts/runtime
31+
publish-js-client:
32+
name: Publish JS client to NPM
33+
needs: build-js-client
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: Download js client build
37+
uses: actions/download-artifact@v4
38+
with:
39+
name: js-client-18
40+
- uses: actions/setup-node@v4
41+
with:
42+
node-version: 18
43+
- uses: bahmutov/npm-install@v1
44+
with:
45+
install-command: yarn --frozen-lockfile --silent
46+
working-directory: ./
47+
- uses: battila7/get-version-action@v2
48+
- uses: JS-DevTools/npm-publish@v3
49+
with:
50+
token: ${{ secrets.NPM_TOKEN }}
51+
tag: ${{ steps.get_version.outputs.version }}
52+
access: public

0 commit comments

Comments
 (0)