|
12 | 12 | # description: 'Tags'
|
13 | 13 | push:
|
14 | 14 | tags:
|
15 |
| - - 'v*' |
| 15 | + - "v*" |
16 | 16 | jobs:
|
17 | 17 | release:
|
18 |
| - |
19 | 18 | runs-on: ubuntu-latest
|
20 | 19 | strategy:
|
21 | 20 | matrix:
|
22 |
| - node-version: [ 16.x ] |
| 21 | + node-version: [18.x] |
23 | 22 | # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
24 | 23 |
|
25 | 24 | steps:
|
26 |
| - - uses: actions/checkout@v3 |
27 |
| - - name: '使用 Use Node.js ${{ matrix.node-version }}' |
28 |
| - uses: actions/setup-node@v3 |
29 |
| - with: |
30 |
| - node-version: ${{ matrix.node-version }} |
31 |
| - cache: 'npm' |
32 |
| - - name: '缓存 Cache' |
33 |
| - uses: actions/cache@v3 |
34 |
| - id: cache-dependencies |
35 |
| - with: |
36 |
| - path: node_modules |
37 |
| - key: ${{runner.OS}}-${{hashFiles('**/yarn.lock')}} |
38 |
| - - name: Fetch all tags |
39 |
| - run: sudo git fetch --force --tags |
40 |
| - - name: '读取当前版本号 Read the current version number' |
41 |
| - id: version |
42 |
| - uses: zhanghengxin/reading-a-file-of-JSON@ice |
43 |
| - with: |
44 |
| - path: ./package.json |
45 |
| - property: |
46 |
| - version |
47 |
| - - name: Get version |
48 |
| - id: get_version |
49 |
| - run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} |
50 |
| - - name: '输出 echo artifact' |
51 |
| - run: | |
52 |
| - echo ${{ steps.version.outputs.value }} |
53 |
| - echo github ${{ github }} |
54 |
| - echo github.sha ${{ github.sha }} |
55 |
| - echo env.VERSION ${{ steps.get_version.outputs.VERSION }} |
56 |
| - - run: yarn install |
57 |
| - - run: yarn build |
58 |
| - - run: | |
59 |
| - tar -zcvf linux-all-casaos-${{ steps.get_version.outputs.VERSION }}.tar.gz build |
60 |
| - - name: '更新 Update release' |
61 |
| - uses: zhanghengxin/git-release-private@ice |
62 |
| - with: |
63 |
| - token: ${{ secrets.GITHUB_TOKEN }} |
64 |
| - allow_override: true |
65 |
| - gzip: false |
66 |
| - prerelease: true |
67 |
| - tag: ${{ steps.get_version.outputs.VERSION }} |
68 |
| - files: ./linux-all-casaos-${{ steps.get_version.outputs.VERSION }}.tar.gz |
| 25 | + - uses: actions/checkout@v3 |
| 26 | + - name: "使用 Use Node.js ${{ matrix.node-version }}" |
| 27 | + uses: actions/setup-node@v3 |
| 28 | + with: |
| 29 | + node-version: ${{ matrix.node-version }} |
| 30 | + cache: "npm" |
| 31 | + - name: "缓存 Cache" |
| 32 | + uses: actions/cache@v3 |
| 33 | + id: cache-dependencies |
| 34 | + with: |
| 35 | + path: node_modules |
| 36 | + key: ${{runner.OS}}-${{hashFiles('**/yarn.lock')}} |
| 37 | + - name: Fetch all tags |
| 38 | + run: sudo git fetch --force --tags |
| 39 | + - name: "读取当前版本号 Read the current version number" |
| 40 | + id: version |
| 41 | + uses: zhanghengxin/reading-a-file-of-JSON@ice |
| 42 | + with: |
| 43 | + path: ./package.json |
| 44 | + property: version |
| 45 | + - name: Get version |
| 46 | + id: get_version |
| 47 | + run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} |
| 48 | + - name: "输出 echo artifact" |
| 49 | + run: | |
| 50 | + echo ${{ steps.version.outputs.value }} |
| 51 | + echo github ${{ github }} |
| 52 | + echo github.sha ${{ github.sha }} |
| 53 | + echo env.VERSION ${{ steps.get_version.outputs.VERSION }} |
| 54 | + - name: Install pnpm |
| 55 | + uses: pnpm/action-setup@v2 |
| 56 | + with: |
| 57 | + version: 9.12.2 |
| 58 | + run_install: false |
| 59 | + |
| 60 | + - run: pnpm install |
| 61 | + - run: pnpm build |
| 62 | + - run: | |
| 63 | + tar -zcvf linux-all-casaos-${{ steps.get_version.outputs.VERSION }}.tar.gz build |
| 64 | + - name: "更新 Update release" |
| 65 | + uses: zhanghengxin/git-release-private@ice |
| 66 | + with: |
| 67 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 68 | + allow_override: true |
| 69 | + gzip: false |
| 70 | + prerelease: true |
| 71 | + tag: ${{ steps.get_version.outputs.VERSION }} |
| 72 | + files: ./linux-all-casaos-${{ steps.get_version.outputs.VERSION }}.tar.gz |
69 | 73 |
|
70 |
| - - name: Upload to oss |
71 |
| - id: upload_to_oss |
72 |
| - uses: tvrcgo/upload-to-oss@master |
73 |
| - with: |
74 |
| - key-id: ${{ secrets.OSS_KEY_ID }} |
75 |
| - key-secret: ${{ secrets.OSS_KEY_SECRET }} |
76 |
| - region: oss-cn-shanghai |
77 |
| - bucket: casaos |
78 |
| - assets: | |
79 |
| - ./linux-all-casaos-${{ steps.get_version.outputs.VERSION }}.tar.gz:/IceWhaleTech/CasaOS-UI/releases/download/${{ steps.get_version.outputs.VERSION }}/linux-all-casaos-${{ steps.get_version.outputs.VERSION }}.tar.gz |
| 74 | + - name: Upload to oss |
| 75 | + id: upload_to_oss |
| 76 | + uses: tvrcgo/upload-to-oss@master |
| 77 | + with: |
| 78 | + key-id: ${{ secrets.OSS_KEY_ID }} |
| 79 | + key-secret: ${{ secrets.OSS_KEY_SECRET }} |
| 80 | + region: oss-cn-shanghai |
| 81 | + bucket: casaos |
| 82 | + assets: | |
| 83 | + ./linux-all-casaos-${{ steps.get_version.outputs.VERSION }}.tar.gz:/IceWhaleTech/CasaOS-UI/releases/download/${{ steps.get_version.outputs.VERSION }}/linux-all-casaos-${{ steps.get_version.outputs.VERSION }}.tar.gz |
0 commit comments