From 9d7729f548578a03770a2dc382bd5df01fc0f58e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=8B=E7=93=9C=E4=B8=80=E5=8D=81=E9=9B=AA?= Date: Tue, 16 Apr 2024 12:21:50 +0800 Subject: [PATCH] fix:workflow --- .github/workflows/release.yml | 32 +++++++++++++++++++++----------- script/checkVersion.js | 0 2 files changed, 21 insertions(+), 11 deletions(-) create mode 100644 script/checkVersion.js diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0f16284b..1cc2e7a4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,6 +5,23 @@ on: - "v*" jobs: + check-version: + runs-on: ubuntu-latest + steps: + - name: Clone Repository + uses: actions/checkout@v4 + + - name: Extract version from tag + run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV + - name: Use Node.js 20.X + uses: actions/setup-node@v4 + with: + node-version: 20.x + + - name: Check Version + run: | + ls + node ./checkVersion.js build-linux: runs-on: ubuntu-latest strategy: @@ -24,12 +41,6 @@ jobs: with: node-version: 20.x - - name: Extract version from tag - run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV - - - name: Print version - run: echo $VERSION - - name: Build NuCat Linux run: | npm i --arch=${{ matrix.target_arch }} --platform=${{ matrix.target_platform }} @@ -56,15 +67,11 @@ jobs: repository: 'NapNeko/NapCatQQ' submodules: true token: ${{ secrets.NAPCAT_BUILD }} + - name: Use Node.js 20.X uses: actions/setup-node@v4 with: node-version: 20.x - - name: Extract version from tag - run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV - - - name: Print version - run: echo $VERSION - name: Build NuCat Linux run: | @@ -73,11 +80,13 @@ jobs: cd dist npm i --omit=dev --arch=${{ matrix.target_arch }} --platform=${{ matrix.target_platform }} cd .. + - name: Upload Artifact uses: actions/upload-artifact@v4 with: name: NapCat.${{ matrix.target_platform }}.${{ matrix.target_arch }} path: dist + release-napcat: needs: [build-win32,build-linux] runs-on: ubuntu-latest @@ -91,6 +100,7 @@ jobs: base=$(basename "$dir") zip -r "${base}.zip" "$dir" done + - name: Create Release Draft and Upload Artifacts uses: softprops/action-gh-release@v1 with: diff --git a/script/checkVersion.js b/script/checkVersion.js new file mode 100644 index 00000000..e69de29b