Skip to content

Commit 6673451

Browse files
committed
ci: Cache for bump
1 parent 3c070d4 commit 6673451

File tree

4 files changed

+26
-11
lines changed

4 files changed

+26
-11
lines changed

.github/workflows/bump-version.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
with:
3030
path: |
3131
.nx
32-
key: ${{ runner.os }}-nx-master"
32+
key: ${{ runner.os }}-nx-master
3333
- name: Test and build
3434
run: npx nx affected -t test build --parallel=3 --exclude='json-api-front,json-api-server,json-api-server-e2e,json-shared-type,database,@nestjs-json-api/source'
3535
- name: Upload test coverage badge
@@ -76,7 +76,7 @@ jobs:
7676
with:
7777
path: |
7878
.nx
79-
key: ${{ runner.os }}-nx-master"
79+
key: ${{ runner.os }}-nx-master
8080
- run: git branch --track main origin/master
8181
- run: npm run typeorm migration:run
8282
- run: npm run seed:run
@@ -109,7 +109,7 @@ jobs:
109109
run: |
110110
git config user.name 'Alex H'
111111
git config user.email '[email protected]'
112-
npx nx release --skip-publish --dry-run
112+
npx nx release --skip-publish
113113
shell: bash
114114
env:
115115
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
with:
2626
path: |
2727
.nx
28-
key: ${{ runner.os }}-nx-${{ steps.branch-names.outputs.current_branch }}"
28+
key: ${{ runner.os }}-nx-${{ steps.branch-names.outputs.current_branch }}
2929
- run: git branch --track main origin/master
3030
- name: Test and build
3131
run: npx nx affected -t test build --parallel=3 --exclude='json-api-front,json-api-server,json-api-server-e2e,json-shared-type,database,@nestjs-json-api/source'
@@ -74,7 +74,7 @@ jobs:
7474
with:
7575
path: |
7676
.nx
77-
key: ${{ runner.os }}-nx-${{ steps.branch-names.outputs.current_branch }}"
77+
key: ${{ runner.os }}-nx-${{ steps.branch-names.outputs.current_branch }}
7878
- run: git branch --track main origin/master
7979
- run: npm run typeorm migration:run
8080
- run: npm run seed:run

.github/workflows/publish.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
name: Publish
22

33
on:
4-
workflow_run:
5-
workflows: [ "Create Releases" ]
6-
types:
7-
- completed
4+
# workflow_run:
5+
# workflows: [ "Create Releases" ]
6+
# types:
7+
# - completed
8+
workflow_dispatch:
89
env:
910
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
1011
NPM_CONFIG_PROVENANCE: true
@@ -25,10 +26,24 @@ jobs:
2526
fetch-depth: 0
2627
- name: Npm install
2728
uses: ./.github/actions
29+
- name: Restore cached .nx
30+
id: cache-nx-restore
31+
uses: actions/cache/restore@v4
32+
with:
33+
path: |
34+
.nx
35+
key: ${{ runner.os }}-nx-master
2836
- run: npx nx affected -t build --parallel=3 --exclude='json-api-front,json-api-server,json-api-server-e2e,shared-utils,json-shared-type,database'
2937
- name: Publish packages
30-
run: npx nx release publish
38+
run: npx nx release publish --dry-run
3139
shell: bash
3240
env:
3341
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3442
NPM_CONFIG_PROVENANCE: true
43+
- name: Save cached .nx
44+
id: cache-dependencies-save
45+
uses: actions/cache/save@v4
46+
with:
47+
path: |
48+
.nx
49+
key: ${{ steps.cache-nx-restore.outputs.cache-primary-key }}

tools/scripts/prepare-for-angular.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ writeFileSync(
1414
promisify(exec)(
1515
`nx run json-api-nestjs-sdk:compile-for-angular`
1616
).then(r => {
17-
console.log(r)
1817
writeFileSync(LIB_ANGULAR_MODULE_PATH, readFileSync(ANGULAR_MODULE_PATH))
18+
console.log(readFileSync(LIB_ANGULAR_MODULE_PATH));
1919
}).finally(() => {
2020
unlinkSync(TEMP_FILE_PATH)
2121
})

0 commit comments

Comments
 (0)