From 3eddfa0ffa723d37d8bce89f9355ed987a88702d Mon Sep 17 00:00:00 2001 From: jackwener Date: Thu, 16 Apr 2026 23:49:00 +0800 Subject: [PATCH] fix: add permissions:write, fix Windows copy to use PowerShell syntax --- .github/workflows/release.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e43ac2a..0bf9738 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,6 +5,9 @@ on: tags: ['v*'] workflow_dispatch: +permissions: + contents: write + jobs: check: runs-on: ubuntu-latest @@ -88,10 +91,11 @@ jobs: - name: Copy binary (Windows) if: matrix.os == 'windows-latest' + shell: pwsh run: | - copy target\${{ matrix.target }}\release\wx.exe ${{ matrix.asset }} - if not exist npm\platforms\${{ matrix.npm_dir }}\bin mkdir npm\platforms\${{ matrix.npm_dir }}\bin - copy target\${{ matrix.target }}\release\wx.exe npm\platforms\${{ matrix.npm_dir }}\bin\wx.exe + Copy-Item "target\${{ matrix.target }}\release\wx.exe" "${{ matrix.asset }}" + New-Item -ItemType Directory -Force -Path "npm\platforms\${{ matrix.npm_dir }}\bin" | Out-Null + Copy-Item "target\${{ matrix.target }}\release\wx.exe" "npm\platforms\${{ matrix.npm_dir }}\bin\wx.exe" - uses: actions/upload-artifact@v4 with: @@ -108,8 +112,6 @@ jobs: if: startsWith(github.ref, 'refs/tags/') with: files: ${{ matrix.asset }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} publish-npm: needs: build