Upgrade softprops/action-gh-release to v0.1.15 for release and nightly build workflow (#10331)

This commit is contained in:
Justin Ma 2023-09-12 21:05:55 +08:00 committed by GitHub
parent 9e1e2a4320
commit abcb0877e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 10 deletions

View File

@ -13,7 +13,7 @@ on:
- nightly # Just for test purpose only with the nightly repo
# This schedule will run only from the default branch
schedule:
- cron: '15 1 * * *' # run at 01:15 AM UTC
- cron: '15 0 * * *' # run at 00:15 AM UTC
defaults:
run:
@ -53,14 +53,13 @@ jobs:
# We can't push if no user name and email are configured
git config user.name 'hustcer'
git config user.email 'hustcer@outlook.com'
git fetch origin main
git pull origin main
git remote add src https://github.com/nushell/nushell.git
git fetch src main
# git pull --rebase src main
# All the changes will be overwritten by the upstream main branch
git reset --hard src/main
git push origin main -f
let sha_short = (git rev-parse --short src/main | str trim | str substring 0..7)
let sha_short = (git rev-parse --short origin/main | str trim | str substring 0..7)
let tag_name = $'nightly-($sha_short)'
if (git ls-remote --tags origin $tag_name | is-empty) {
git tag -a $tag_name -m $'Nightly build from ($sha_short)'
@ -176,7 +175,7 @@ jobs:
# REF: https://github.com/marketplace/actions/gh-release
# Create a release only in nushell/nightly repo
- name: Publish Archive
uses: softprops/action-gh-release@v0.1.13
uses: softprops/action-gh-release@v0.1.15
if: ${{ startsWith(github.repository, 'nushell/nightly') }}
with:
draft: false

View File

@ -172,18 +172,22 @@ if $os in [$USE_UBUNTU, 'macos-latest'] {
cp -r $'($dist)/*' target/release/
cargo install cargo-wix --version 0.3.4
cargo wix --no-build --nocapture --package nu --output $wixRelease
print $'archive: ---> ($wixRelease)';
echo $"archive=($wixRelease)" | save --append $env.GITHUB_OUTPUT
# Workaround for https://github.com/softprops/action-gh-release/issues/280
let archive = ($wixRelease | str replace -a '\' '/')
print $'archive: ---> ($archive)';
echo $"archive=($archive)" | save --append $env.GITHUB_OUTPUT
} else {
print $'(char nl)(ansi g)Archive contents:(ansi reset)'; hr-line; ls
let archive = $'($dist)/($releaseStem).zip'
7z a $archive *
print $'archive: ---> ($archive)';
let pkg = (ls -f $archive | get name)
if not ($pkg | is-empty) {
echo $"archive=($pkg | get 0)" | save --append $env.GITHUB_OUTPUT
# Workaround for https://github.com/softprops/action-gh-release/issues/280
let archive = ($pkg | get 0 | str replace -a '\' '/')
print $'archive: ---> ($archive)'
echo $"archive=($archive)" | save --append $env.GITHUB_OUTPUT
}
}
}

View File

@ -102,7 +102,7 @@ jobs:
# REF: https://github.com/marketplace/actions/gh-release
- name: Publish Archive
uses: softprops/action-gh-release@v0.1.13
uses: softprops/action-gh-release@v0.1.15
if: ${{ startsWith(github.ref, 'refs/tags/') }}
with:
draft: true