fix: using powershell on windows (#434)

Co-authored-by: rick <LinuxSuRen@users.noreply.github.com>
This commit is contained in:
Rick 2024-05-16 09:38:30 +08:00 committed by GitHub
parent 344694031b
commit 3f7749ae66
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 34 additions and 2 deletions

View File

@ -138,7 +138,7 @@ jobs:
- name: Upload to Draft
env:
GITHUB_TOKEN: ${{ secrets.GH_PUBLISH_SECRETS }}
if: github.ref == 'refs/heads/master'
if: github.ref == 'refs/heads/master' && runner.os != 'Windows'
run: |
cd console/atest-desktop
export TAG=$(gh release list -L 1 | awk '{print $4}')
@ -146,10 +146,26 @@ jobs:
jq '.version = env.TAG' package.json > package.json.new && mv package.json.new package.json
npm i
npm run publish
- name: Upload to Draft on Windows
env:
GITHUB_TOKEN: ${{ secrets.GH_PUBLISH_SECRETS }}
if: github.ref == 'refs/heads/master' && runner.os == 'Windows'
run: |
cd console/atest-desktop
$TAG = (gh release list -L 1).Split(' ')[0]
if ($TAG -like "v*") {
$TAG = $TAG -replace "^v", ""
}
Set-Content -Path "env:TAG" -Value "$TAG"
jq '.version = env.TAG' package.json > package.json.new
rm package.json
Rename-Item -Path package.json.new -NewName package.json
npm i
npm run publish
- name: Upload
env:
GITHUB_TOKEN: ${{ secrets.GH_PUBLISH_SECRETS }}
if: github.ref != 'refs/heads/master'
if: github.ref != 'refs/heads/master' && runner.os != 'Windows'
run: |
cd console/atest-desktop
export TAG=$(git describe --tags --abbrev=0)
@ -157,6 +173,22 @@ jobs:
jq '.version = env.TAG' package.json > package.json.new && mv package.json.new package.json
npm i
npm run publish
- name: Upload on Windows
env:
GITHUB_TOKEN: ${{ secrets.GH_PUBLISH_SECRETS }}
if: github.ref != 'refs/heads/master' && runner.os == 'Windows'
run: |
cd console/atest-desktop
$TAG = git describe --tags --abbrev=0
if ($TAG -like "v*") {
$TAG = $TAG -replace "^v", ""
}
Set-Content -Path "env:TAG" -Value "$TAG"
jq '.version = env.TAG' package.json > package.json.new
rm package.json
Rename-Item -Path package.json.new -NewName package.json
npm i
npm run publish
# image-operator:
# runs-on: ubuntu-20.04