diff --git a/.github/workflows/release-pkg.nu b/.github/workflows/release-pkg.nu index 2c5a5cd818..754ff7b535 100755 --- a/.github/workflows/release-pkg.nu +++ b/.github/workflows/release-pkg.nu @@ -31,8 +31,13 @@ let flags = $env.TARGET_RUSTFLAGS let dist = $'($env.GITHUB_WORKSPACE)/output' let version = (open Cargo.toml | get package.version) +$'Debugging info:' +print { version: $version, bin: $bin, os: $os, target: $target, src: $src, flags: $flags, dist: $dist }; hr-line -b + # $env +let USE_UBUNTU = 'ubuntu-20.04' + $'(char nl)Packaging ($bin) v($version) for ($target) in ($src)...'; hr-line -b if not ('Cargo.lock' | path exists) { cargo generate-lockfile } @@ -41,8 +46,8 @@ $'Start building ($bin)...'; hr-line # ---------------------------------------------------------------------------- # Build for Ubuntu and macOS # ---------------------------------------------------------------------------- -if $os in ['ubuntu-latest', 'macos-latest'] { - if $os == 'ubuntu-latest' { +if $os in [$USE_UBUNTU, 'macos-latest'] { + if $os == $USE_UBUNTU { sudo apt-get install libxcb-composite0-dev -y } if $target == 'aarch64-unknown-linux-gnu' { @@ -56,7 +61,7 @@ if $os in ['ubuntu-latest', 'macos-latest'] { } else { # musl-tools to fix 'Failed to find tool. Is `musl-gcc` installed?' # Actually just for x86_64-unknown-linux-musl target - if $os == 'ubuntu-latest' { sudo apt install musl-tools -y } + if $os == $USE_UBUNTU { sudo apt install musl-tools -y } cargo-build-nu $flags } } @@ -103,7 +108,7 @@ if ($ver | str trim | is-empty) { # Create a release archive and send it to output for the following steps # ---------------------------------------------------------------------------- cd $dist; $'(char nl)Creating release archive...'; hr-line -if $os in ['ubuntu-latest', 'macos-latest'] { +if $os in [$USE_UBUNTU, 'macos-latest'] { let files = (ls | get name) let dest = $'($bin)-($version)-($target)' @@ -116,7 +121,8 @@ if $os in ['ubuntu-latest', 'macos-latest'] { tar -czf $archive $dest print $'archive: ---> ($archive)'; ls $archive - echo $'::set-output name=archive::($archive)' + # REF: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ + echo $"archive=($archive)" | save --append $env.GITHUB_OUTPUT } else if $os == 'windows-latest' { @@ -136,7 +142,8 @@ if $os in ['ubuntu-latest', 'macos-latest'] { cp -r $'($dist)/*' target/release/ cargo install cargo-wix --version 0.3.3 cargo wix --no-build --nocapture --package nu --output $wixRelease - echo $'::set-output name=archive::($wixRelease)' + print $'archive: ---> ($wixRelease)'; + echo $"archive=($wixRelease)" | save --append $env.GITHUB_OUTPUT } else { @@ -146,7 +153,7 @@ if $os in ['ubuntu-latest', 'macos-latest'] { print $'archive: ---> ($archive)'; let pkg = (ls -f $archive | get name) if not ($pkg | is-empty) { - echo $'::set-output name=archive::($pkg | get 0)' + echo $"archive=($pkg | get 0)" | save --append $env.GITHUB_OUTPUT } } } diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9319dd15d5..08a0e660db 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,22 +44,22 @@ jobs: os: windows-latest target_rustflags: '' - target: x86_64-unknown-linux-gnu - os: ubuntu-latest + os: ubuntu-20.04 target_rustflags: '' - target: x86_64-unknown-linux-musl - os: ubuntu-latest + os: ubuntu-20.04 target_rustflags: '' - target: aarch64-unknown-linux-gnu - os: ubuntu-latest + os: ubuntu-20.04 target_rustflags: '' - target: armv7-unknown-linux-gnueabihf - os: ubuntu-latest + os: ubuntu-20.04 target_rustflags: '' runs-on: ${{matrix.os}} steps: - - uses: actions/checkout@v3.0.2 + - uses: actions/checkout@v3.1.0 - name: Install Rust Toolchain Components uses: actions-rs/toolchain@v1.0.6 @@ -70,9 +70,9 @@ jobs: target: ${{ matrix.target }} - name: Setup Nushell - uses: hustcer/setup-nu@v2.1 + uses: hustcer/setup-nu@v3 with: - version: 0.69.1 + version: 0.71.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}