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

View file

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