Skip to content

Commit

Permalink
ci: Cache for bump
Browse files Browse the repository at this point in the history
  • Loading branch information
klerick committed Mar 7, 2024
1 parent 3c070d4 commit 6673451
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 11 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
with:
path: |
.nx
key: ${{ runner.os }}-nx-master"
key: ${{ runner.os }}-nx-master
- name: Test and build
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'
- name: Upload test coverage badge
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
with:
path: |
.nx
key: ${{ runner.os }}-nx-master"
key: ${{ runner.os }}-nx-master
- run: git branch --track main origin/master
- run: npm run typeorm migration:run
- run: npm run seed:run
Expand Down Expand Up @@ -109,7 +109,7 @@ jobs:
run: |
git config user.name 'Alex H'
git config user.email '[email protected]'
npx nx release --skip-publish --dry-run
npx nx release --skip-publish
shell: bash
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
with:
path: |
.nx
key: ${{ runner.os }}-nx-${{ steps.branch-names.outputs.current_branch }}"
key: ${{ runner.os }}-nx-${{ steps.branch-names.outputs.current_branch }}
- run: git branch --track main origin/master
- name: Test and build
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'
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:
with:
path: |
.nx
key: ${{ runner.os }}-nx-${{ steps.branch-names.outputs.current_branch }}"
key: ${{ runner.os }}-nx-${{ steps.branch-names.outputs.current_branch }}
- run: git branch --track main origin/master
- run: npm run typeorm migration:run
- run: npm run seed:run
Expand Down
25 changes: 20 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: Publish

on:
workflow_run:
workflows: [ "Create Releases" ]
types:
- completed
# workflow_run:
# workflows: [ "Create Releases" ]
# types:
# - completed
workflow_dispatch:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
NPM_CONFIG_PROVENANCE: true
Expand All @@ -25,10 +26,24 @@ jobs:
fetch-depth: 0
- name: Npm install
uses: ./.github/actions
- name: Restore cached .nx
id: cache-nx-restore
uses: actions/cache/restore@v4
with:
path: |
.nx
key: ${{ runner.os }}-nx-master
- 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'
- name: Publish packages
run: npx nx release publish
run: npx nx release publish --dry-run
shell: bash
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true
- name: Save cached .nx
id: cache-dependencies-save
uses: actions/cache/save@v4
with:
path: |
.nx
key: ${{ steps.cache-nx-restore.outputs.cache-primary-key }}
2 changes: 1 addition & 1 deletion tools/scripts/prepare-for-angular.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ writeFileSync(
promisify(exec)(
`nx run json-api-nestjs-sdk:compile-for-angular`
).then(r => {
console.log(r)
writeFileSync(LIB_ANGULAR_MODULE_PATH, readFileSync(ANGULAR_MODULE_PATH))
console.log(readFileSync(LIB_ANGULAR_MODULE_PATH));
}).finally(() => {
unlinkSync(TEMP_FILE_PATH)
})
Expand Down

0 comments on commit 6673451

Please sign in to comment.