Skip to content

Commit 98d1c71

Browse files
committed
chore: proper dist folder for npm release pipeline
1 parent 80dbf6b commit 98d1c71

File tree

7 files changed

+1934
-1071
lines changed

7 files changed

+1934
-1071
lines changed

.github/workflows/nx-release.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# @see https://nx.dev/recipes/nx-release/publish-in-ci-cd
2+
name: Publish
3+
4+
on:
5+
workflow_dispatch:
6+
7+
jobs:
8+
test:
9+
name: Publish
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
id-token: write # needed for provenance data generation
14+
timeout-minutes: 10
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Install Node
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: 20
25+
registry-url: https://registry.npmjs.org/
26+
27+
- name: Install dependencies
28+
run: npm install
29+
shell: bash
30+
31+
- name: Print Environment Info
32+
run: npx nx report
33+
shell: bash
34+
35+
- name: Publish packages
36+
run: npx nx release publish
37+
shell: bash
38+
env:
39+
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
40+
NPM_CONFIG_PROVENANCE: true

.github/workflows/release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ jobs:
9494
# Publish version to public repository
9595
- name: Publish release version
9696
if: startsWith(github.event.inputs.release-type, 'pre') != true
97-
working-directory: packages/rxdb
97+
working-directory: dist/packages/rxdb
9898
run: |
9999
npm pack
100100
npm publish --access public --non-interactive --no-git-tag-version --tag latest
@@ -104,7 +104,7 @@ jobs:
104104
# Publish version to public repository
105105
- name: Publish pre-release version
106106
if: startsWith(github.event.inputs.release-type, 'pre')
107-
working-directory: packages/rxdb
107+
working-directory: dist/packages/rxdb
108108
run: |
109109
npm pack
110110
npm publish --access public --non-interactive --no-git-tag-version --tag dev

nx.json

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,28 @@
88
"affected": {
99
"defaultBase": "origin/master"
1010
},
11+
"release": {
12+
"projects": [
13+
"packages/*"
14+
],
15+
"projectChangelogs": {
16+
"createRelease": "github"
17+
},
18+
"version": {
19+
"generatorOptions": {
20+
"preid": "dev"
21+
}
22+
}
23+
},
1124
"targetDefaults": {
1225
"build": {
13-
"dependsOn": ["^build"],
14-
"inputs": ["production", "^production"],
26+
"dependsOn": [
27+
"^build"
28+
],
29+
"inputs": [
30+
"production",
31+
"^production"
32+
],
1533
"cache": true
1634
},
1735
"lint": {
@@ -24,7 +42,11 @@
2442
"cache": true
2543
},
2644
"@nx/jest:jest": {
27-
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"],
45+
"inputs": [
46+
"default",
47+
"^production",
48+
"{workspaceRoot}/jest.preset.js"
49+
],
2850
"cache": true,
2951
"options": {
3052
"passWithNoTests": true
@@ -38,7 +60,10 @@
3860
}
3961
},
4062
"namedInputs": {
41-
"default": ["{projectRoot}/**/*", "sharedGlobals"],
63+
"default": [
64+
"{projectRoot}/**/*",
65+
"sharedGlobals"
66+
],
4267
"production": [
4368
"default",
4469
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",

0 commit comments

Comments
 (0)