Skip to content

Commit 5cdd8ce

Browse files
committed
ci: publish job
1 parent 06558d0 commit 5cdd8ce

File tree

2 files changed

+70
-35
lines changed

2 files changed

+70
-35
lines changed

.github/workflows/new-release.yml

Lines changed: 41 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -91,43 +91,42 @@ jobs:
9191
project3: ${{ github.event.inputs.project3 }}
9292
project4: ${{ github.event.inputs.project4 }}
9393

94-
# test:
95-
# needs: [compute-projects]
96-
# uses: ./.github/workflows/test.yml
97-
# with:
98-
# mainBranch: "last-tag"
99-
# secrets:
100-
# NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
101-
#
102-
# e2e-test:
103-
# needs: [test]
104-
# uses: ./.github/workflows/e2e-test.yml
105-
# with:
106-
# mainBranch: "last-tag"
107-
# secrets:
108-
# NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
109-
#
110-
# build:
111-
# needs: [test, e2e-test]
112-
# uses: ./.github/workflows/build.yml
113-
# with:
114-
# mainBranch: "last-tag"
115-
# secrets:
116-
# NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
117-
#
118-
# upload-badge:
119-
# needs: [ test, e2e-test ]
120-
# uses: ./.github/workflows/upload-badge.yml
121-
# with:
122-
# mainBranch: "last-tag"
123-
# secrets:
124-
# NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
125-
# GIST_SECRET: ${{ secrets.GIST_SECRET }}
126-
# GIST_ID: ${{ secrets.GIST_ID }}
94+
test:
95+
needs: [compute-projects]
96+
uses: ./.github/workflows/test.yml
97+
with:
98+
mainBranch: "last-tag"
99+
secrets:
100+
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
101+
102+
e2e-test:
103+
needs: [test]
104+
uses: ./.github/workflows/e2e-test.yml
105+
with:
106+
mainBranch: "last-tag"
107+
secrets:
108+
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
109+
110+
build:
111+
needs: [test, e2e-test]
112+
uses: ./.github/workflows/build.yml
113+
with:
114+
mainBranch: "last-tag"
115+
secrets:
116+
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
117+
118+
upload-badge:
119+
needs: [ test, e2e-test ]
120+
uses: ./.github/workflows/upload-badge.yml
121+
with:
122+
mainBranch: "last-tag"
123+
secrets:
124+
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
125+
GIST_SECRET: ${{ secrets.GIST_SECRET }}
126+
GIST_ID: ${{ secrets.GIST_ID }}
127127

128128
bump-version:
129-
# needs: [build]
130-
needs: [compute-projects]
129+
needs: [build]
131130
uses: ./.github/workflows/bump-version.yml
132131
with:
133132
projects: ${{ needs.compute-projects.outputs.finalProjects }}
@@ -137,3 +136,10 @@ jobs:
137136
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
138137
GITHUB_TOKEN_SECRET: ${{ secrets.GITHUB_TOKEN }}
139138
PAT: ${{secrets.PAT}}
139+
140+
publish:
141+
if: ${{ fromJSON(github.event.inputs.dry-run) == false }}
142+
needs: [bump-version]
143+
uses: ./.github/workflows/publish.yml
144+
secrets:
145+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/publish.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: ⚙️ Publish
2+
3+
4+
on:
5+
workflow_call:
6+
secrets:
7+
NPM_TOKEN:
8+
required: true
9+
10+
env:
11+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
12+
NPM_CONFIG_PROVENANCE: true
13+
14+
jobs:
15+
publish:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Setup Node.js
22+
uses: ./.github/actions
23+
24+
- name: Build
25+
run: npx nx affected -t build --parallel=3 --exclude='*,!tag:type:publish'
26+
27+
- name: Publish packages
28+
run: npx nx release publish
29+

0 commit comments

Comments
 (0)