Skip to content

Commit

Permalink
Update npm-publish-github-packages.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
nfzwyio authored Sep 21, 2024
1 parent dcb2fc1 commit 95f5940
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions .github/workflows/npm-publish-github-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

strategy:
matrix:
node-version: [20.x]
node-version: [18.x, 20.x, 22.x]

steps:
- uses: actions/checkout@v4
Expand All @@ -24,32 +24,26 @@ jobs:
- name: Install dependencies
run: npm ci



- name: Combine Data
run: npm run combineData --languages chinesesimplified --folders characters

- name: List files in the current directory
run: ls -la
if: always() # 始终运行这个步骤以便于调试

- name: List files in the dist directory
run: ls -la dist/
if: always() # 始终运行这个步骤以便于调试
continue-on-error: true # 如果目录不存在,继续执行后续步骤

- name: Upload combined data as artifact
if: success()
uses: actions/upload-artifact@v3
with:
name: combined-data
path: dist/ # 请根据实际情况调整输出目录
path: dist/ # 确保与实际输出目录匹配
retention-days: 7 # 可以设置保留天数

publish-gpr:
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://npm.pkg.github.com/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
runs-on: ubuntu-latest

0 comments on commit 95f5940

Please sign in to comment.