Skip to content

Commit

Permalink
fix: using powershell on windows (#434)
Browse files Browse the repository at this point in the history
Co-authored-by: rick <LinuxSuRen@users.noreply.github.com>
  • Loading branch information
LinuxSuRen and LinuxSuRen authored May 16, 2024
1 parent 3446940 commit 3f7749a
Showing 1 changed file with 34 additions and 2 deletions.
36 changes: 34 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,25 +138,57 @@ 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}')
export TAG=${TAG#"v"}
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)
export TAG=${TAG#"v"}
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
Expand Down

0 comments on commit 3f7749a

Please sign in to comment.