Skip to content

Commit

Permalink
Upgrade softprops/action-gh-release to v0.1.15 for release and nightl…
Browse files Browse the repository at this point in the history
…y build workflow (#10331)
  • Loading branch information
hustcer committed Sep 12, 2023
1 parent 9e1e2a4 commit abcb087
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/nightly-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)'
Expand Down Expand Up @@ -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
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/release-pkg.nu
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit abcb087

Please sign in to comment.