Skip to content

Commit 1e360f1

Browse files
committed
fix(release): fixing nx cache to make release
1 parent f24ce43 commit 1e360f1

File tree

1 file changed

+9
-43
lines changed

1 file changed

+9
-43
lines changed

.github/workflows/on-gh-release.yml

Lines changed: 9 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -20,53 +20,19 @@ jobs:
2020
with:
2121
access_token: ${{ secrets.GITHUB_TOKEN }}
2222

23-
# install dependencies
24-
install:
25-
runs-on: ubuntu-latest
26-
needs: one_run
27-
steps:
28-
- uses: actions/checkout@v3
29-
- uses: actions/cache@v3
30-
id: cache
31-
with:
32-
path: node_modules
33-
key: node_modules-${{ hashFiles('**/package-lock.json') }}
34-
- run: npm ci
35-
if: steps.cache.outputs.cache-hit != 'true'
36-
37-
# build ng2-dragula
38-
build:
39-
needs: install
40-
runs-on: ubuntu-latest
41-
steps:
42-
- uses: actions/checkout@v3
43-
- uses: actions/cache@v3
44-
with:
45-
path: node_modules
46-
key: node_modules-${{ hashFiles('**/package-lock.json') }}
47-
- uses: actions/cache@v3
48-
with:
49-
path: dist
50-
key: dist-${{ github.run_id }}
51-
- run: |
52-
npx nx build ng2-dragula --configuration production
5323
# update npm tags
5424
npm_publish:
5525
runs-on: ubuntu-latest
56-
needs: build
26+
needs: one_run
5727
steps:
5828
- uses: actions/checkout@v3
5929
- uses: actions/cache@v3
60-
with:
61-
path: node_modules
62-
key: node_modules-${{ hashFiles('**/package-lock.json') }}
63-
- uses: actions/cache@v3
64-
with:
65-
path: dist
66-
key: dist-${{ github.run_id }}
67-
- uses: JS-DevTools/npm-publish@v3
68-
with:
69-
package: "./dist/ng2-dragula/package.json"
70-
token: ${{ secrets.NPM_TOKEN }}
71-
tag: latest
30+
- name: get-npm-version
31+
id: package-version
32+
uses: martinbeentjes/npm-get-version-action@v1.3.1
33+
- run: |
34+
npm config set registry https://registry.npmjs.org/
35+
npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
36+
npm dist-tag add ng2-dragula@${{ steps.package-version.outputs.current-version}} latest
37+
7238

0 commit comments

Comments
 (0)