Skip to content

Commit

Permalink
update github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
huww98 committed Jun 11, 2023
1 parent fb4e358 commit bb8cd4e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 36 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '14'
node-version: '18'
cache: 'npm'
- run: npm ci
- run: npm test
Expand Down
45 changes: 12 additions & 33 deletions .github/workflows/npmpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,38 +11,24 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 12
- name: Cache node modules
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-npm-timechart-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-timechart-
${{ runner.os }}-npm-
node-version: 18
cache: 'npm'
- run: npm ci
- run: npm test

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14
node-version: 18
registry-url: https://registry.npmjs.org/
- name: Cache node modules
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-npm-timechart-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-timechart-
${{ runner.os }}-npm-
cache: 'npm'
- run: npm ci
- run: |
TAG=$(node <<EOF
Expand All @@ -57,19 +43,12 @@ jobs:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14
node-version: 18
registry-url: https://npm.pkg.github.com/
- name: Cache node modules
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-npm-timechart-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-timechart-
${{ runner.os }}-npm-
cache: 'npm'
- run: |
npm ci
node <<EOF
Expand Down

0 comments on commit bb8cd4e

Please sign in to comment.