From 278c7bebba8098b7a3f51a4aeb38aedb5a13119d Mon Sep 17 00:00:00 2001 From: ian Date: Fri, 20 Sep 2024 08:33:19 +0800 Subject: [PATCH] ci: upgrade actions in package.yaml --- .github/workflows/package.yaml | 466 ++++++++++++++++----------------- 1 file changed, 233 insertions(+), 233 deletions(-) diff --git a/.github/workflows/package.yaml b/.github/workflows/package.yaml index 0b892f8a..6241229d 100644 --- a/.github/workflows/package.yaml +++ b/.github/workflows/package.yaml @@ -11,7 +11,7 @@ concurrency: on: push: branches: - - 'pkg/*' + - "pkg/*" env: CARGO_TERM_COLOR: always @@ -24,7 +24,7 @@ jobs: outputs: upload_url: ${{ steps.create-release.outputs.upload_url }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set tag run: | export GIT_TAG_NAME=` echo ${{ github.ref }} | awk -F '/' '{print $4}' ` @@ -44,33 +44,33 @@ jobs: name: package-for-linux runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set Env - run: | - export GIT_TAG_NAME=` echo ${{ github.ref }} | awk -F '/' '{print $4}' ` - echo "GIT_TAG_NAME=$GIT_TAG_NAME" >> $GITHUB_ENV - - name: Build and package ckb-cli - env: - LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }} - GPG_SIGNER: ${{ secrets.GPG_SIGNER }} - run: | - export GIT_TAG_NAME=` echo ${{ github.ref }} | awk -F '/' '{print $4}' ` - docker run --rm -i -w /ckb-cli -v $(pwd):/ckb-cli $BUILDER_IMAGE make prod - gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output devtools/ci/signer.asc devtools/ci/signer.asc.gpg - gpg --import devtools/ci/signer.asc - devtools/ci/package.sh target/release/ckb-cli - mv ${{ github.workspace }}/releases/ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }} ${{ github.workspace }} - mv ${{ github.workspace }}/releases/ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc ${{ github.workspace }} - - name: upload-zip-file - uses: actions/upload-artifact@v2 - with: - name: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }} - path: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }} - - name: upload-asc-file - uses: actions/upload-artifact@v2 - with: - name: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc - path: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc + - uses: actions/checkout@v4 + - name: Set Env + run: | + export GIT_TAG_NAME=` echo ${{ github.ref }} | awk -F '/' '{print $4}' ` + echo "GIT_TAG_NAME=$GIT_TAG_NAME" >> $GITHUB_ENV + - name: Build and package ckb-cli + env: + LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }} + GPG_SIGNER: ${{ secrets.GPG_SIGNER }} + run: | + export GIT_TAG_NAME=` echo ${{ github.ref }} | awk -F '/' '{print $4}' ` + docker run --rm -i -w /ckb-cli -v $(pwd):/ckb-cli $BUILDER_IMAGE make prod + gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output devtools/ci/signer.asc devtools/ci/signer.asc.gpg + gpg --import devtools/ci/signer.asc + devtools/ci/package.sh target/release/ckb-cli + mv ${{ github.workspace }}/releases/ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }} ${{ github.workspace }} + mv ${{ github.workspace }}/releases/ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc ${{ github.workspace }} + - name: upload-zip-file + uses: actions/upload-artifact@v4 + with: + name: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }} + path: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }} + - name: upload-asc-file + uses: actions/upload-artifact@v4 + with: + name: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc + path: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc env: BUILDER_IMAGE: nervos/ckb-docker-builder:bionic-rust-1.75.0 REL_PKG: x86_64-unknown-linux-gnu.tar.gz @@ -79,38 +79,38 @@ jobs: name: package-for-linux-aarch64 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set Env - run: | - export GIT_TAG_NAME=` echo ${{ github.ref }} | awk -F '/' '{print $4}' ` - echo "GIT_TAG_NAME=$GIT_TAG_NAME" >> $GITHUB_ENV - - name: Add rust target - run: rustup target add aarch64-unknown-linux-gnu - - name: Install dependencies - run: sudo apt-get update && sudo apt-get install -y gcc-multilib && sudo apt-get install -y build-essential clang gcc-aarch64-linux-gnu g++-aarch64-linux-gnu - - name: Build and package ckb-cli (aarch64) - env: - LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }} - GPG_SIGNER: ${{ secrets.GPG_SIGNER }} - run: | - export GIT_TAG_NAME=` echo ${{ github.ref }} | awk -F '/' '{print $4}' ` - export TOP_DIR=$(pwd) - PKG_CONFIG_ALLOW_CROSS=1 CC=gcc CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc cargo build --target=aarch64-unknown-linux-gnu --release - gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output devtools/ci/signer.asc devtools/ci/signer.asc.gpg - gpg --import devtools/ci/signer.asc - devtools/ci/package.sh target/aarch64-unknown-linux-gnu/release/ckb-cli - mv ${{ github.workspace }}/releases/ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }} ${{ github.workspace }} - mv ${{ github.workspace }}/releases/ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc ${{ github.workspace }} - - name: upload-zip-file - uses: actions/upload-artifact@v2 - with: - name: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }} - path: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }} - - name: upload-asc-file - uses: actions/upload-artifact@v2 - with: - name: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc - path: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc + - uses: actions/checkout@v4 + - name: Set Env + run: | + export GIT_TAG_NAME=` echo ${{ github.ref }} | awk -F '/' '{print $4}' ` + echo "GIT_TAG_NAME=$GIT_TAG_NAME" >> $GITHUB_ENV + - name: Add rust target + run: rustup target add aarch64-unknown-linux-gnu + - name: Install dependencies + run: sudo apt-get update && sudo apt-get install -y gcc-multilib && sudo apt-get install -y build-essential clang gcc-aarch64-linux-gnu g++-aarch64-linux-gnu + - name: Build and package ckb-cli (aarch64) + env: + LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }} + GPG_SIGNER: ${{ secrets.GPG_SIGNER }} + run: | + export GIT_TAG_NAME=` echo ${{ github.ref }} | awk -F '/' '{print $4}' ` + export TOP_DIR=$(pwd) + PKG_CONFIG_ALLOW_CROSS=1 CC=gcc CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc cargo build --target=aarch64-unknown-linux-gnu --release + gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output devtools/ci/signer.asc devtools/ci/signer.asc.gpg + gpg --import devtools/ci/signer.asc + devtools/ci/package.sh target/aarch64-unknown-linux-gnu/release/ckb-cli + mv ${{ github.workspace }}/releases/ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }} ${{ github.workspace }} + mv ${{ github.workspace }}/releases/ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc ${{ github.workspace }} + - name: upload-zip-file + uses: actions/upload-artifact@v4 + with: + name: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }} + path: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }} + - name: upload-asc-file + uses: actions/upload-artifact@v4 + with: + name: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc + path: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc env: REL_PKG: aarch64-unknown-linux-gnu.tar.gz @@ -118,33 +118,33 @@ jobs: name: package-for-centos runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set Env - run: | - export GIT_TAG_NAME=` echo ${{ github.ref }} | awk -F '/' '{print $4}' ` - echo "GIT_TAG_NAME=$GIT_TAG_NAME" >> $GITHUB_ENV - - name: Build and package ckb-cli - env: - LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }} - GPG_SIGNER: ${{ secrets.GPG_SIGNER }} - run: | - export GIT_TAG_NAME=` echo ${{ github.ref }} | awk -F '/' '{print $4}' ` - docker run --rm -i -w /ckb-cli -v $(pwd):/ckb-cli $BUILDER_IMAGE make prod - gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output devtools/ci/signer.asc devtools/ci/signer.asc.gpg - gpg --import devtools/ci/signer.asc - devtools/ci/package.sh target/release/ckb-cli - mv ${{ github.workspace }}/releases/ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }} ${{ github.workspace }} - mv ${{ github.workspace }}/releases/ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc ${{ github.workspace }} - - name: upload-zip-file - uses: actions/upload-artifact@v2 - with: - name: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }} - path: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }} - - name: upload-asc-file - uses: actions/upload-artifact@v2 - with: - name: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc - path: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc + - uses: actions/checkout@v4 + - name: Set Env + run: | + export GIT_TAG_NAME=` echo ${{ github.ref }} | awk -F '/' '{print $4}' ` + echo "GIT_TAG_NAME=$GIT_TAG_NAME" >> $GITHUB_ENV + - name: Build and package ckb-cli + env: + LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }} + GPG_SIGNER: ${{ secrets.GPG_SIGNER }} + run: | + export GIT_TAG_NAME=` echo ${{ github.ref }} | awk -F '/' '{print $4}' ` + docker run --rm -i -w /ckb-cli -v $(pwd):/ckb-cli $BUILDER_IMAGE make prod + gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output devtools/ci/signer.asc devtools/ci/signer.asc.gpg + gpg --import devtools/ci/signer.asc + devtools/ci/package.sh target/release/ckb-cli + mv ${{ github.workspace }}/releases/ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }} ${{ github.workspace }} + mv ${{ github.workspace }}/releases/ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc ${{ github.workspace }} + - name: upload-zip-file + uses: actions/upload-artifact@v4 + with: + name: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }} + path: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }} + - name: upload-asc-file + uses: actions/upload-artifact@v4 + with: + name: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc + path: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc env: BUILDER_IMAGE: nervos/ckb-docker-builder:centos-7-rust-1.75.0 REL_PKG: x86_64-unknown-centos-gnu.tar.gz @@ -153,33 +153,33 @@ jobs: name: package-for-mac runs-on: macos-12 steps: - - uses: actions/checkout@v2 - - name: Set Env - run: | - export GIT_TAG_NAME=` echo ${{ github.ref }} | awk -F '/' '{print $4}' ` - echo "GIT_TAG_NAME=$GIT_TAG_NAME" >> $GITHUB_ENV - - name: Build and package ckb-cli - env: - LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }} - GPG_SIGNER: ${{ secrets.GPG_SIGNER }} - run: | - export GIT_TAG_NAME=` echo ${{ github.ref }} | awk -F '/' '{print $4}' ` - make prod - gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output devtools/ci/signer.asc devtools/ci/signer.asc.gpg - gpg --import devtools/ci/signer.asc - devtools/ci/package.sh target/release/ckb-cli - mv ${{ github.workspace }}/releases/ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }} ${{ github.workspace }} - mv ${{ github.workspace }}/releases/ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc ${{ github.workspace }} - - name: upload-zip-file - uses: actions/upload-artifact@v2 - with: - name: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }} - path: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }} - - name: upload-asc-file - uses: actions/upload-artifact@v2 - with: - name: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc - path: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc + - uses: actions/checkout@v4 + - name: Set Env + run: | + export GIT_TAG_NAME=` echo ${{ github.ref }} | awk -F '/' '{print $4}' ` + echo "GIT_TAG_NAME=$GIT_TAG_NAME" >> $GITHUB_ENV + - name: Build and package ckb-cli + env: + LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }} + GPG_SIGNER: ${{ secrets.GPG_SIGNER }} + run: | + export GIT_TAG_NAME=` echo ${{ github.ref }} | awk -F '/' '{print $4}' ` + make prod + gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output devtools/ci/signer.asc devtools/ci/signer.asc.gpg + gpg --import devtools/ci/signer.asc + devtools/ci/package.sh target/release/ckb-cli + mv ${{ github.workspace }}/releases/ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }} ${{ github.workspace }} + mv ${{ github.workspace }}/releases/ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc ${{ github.workspace }} + - name: upload-zip-file + uses: actions/upload-artifact@v4 + with: + name: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }} + path: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }} + - name: upload-asc-file + uses: actions/upload-artifact@v4 + with: + name: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc + path: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc env: REL_PKG: x86_64-apple-darwin.zip @@ -187,50 +187,50 @@ jobs: name: package-for-mac-aarch64 runs-on: [self-hosted, macOS, ARM64] steps: - - name: Setup PATH - run: | - echo /opt/homebrew/bin >> $GITHUB_PATH - echo /opt/homebrew/sbin >> $GITHUB_PATH - echo "$HOME/.cargo/bin" >> $GITHUB_PATH - - name: Install Depedencies - run: | - if ! [ -d /opt/homebrew/opt/openssl@1.1 ]; then - brew install "openssl@1.1" - fi - if ! type -f gpg &> /dev/null; then - brew install gnupg - fi - if ! [ -f "$HOME/.cargo/bin/rustup" ]; then - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - fi + - name: Setup PATH + run: | + echo /opt/homebrew/bin >> $GITHUB_PATH + echo /opt/homebrew/sbin >> $GITHUB_PATH + echo "$HOME/.cargo/bin" >> $GITHUB_PATH + - name: Install Depedencies + run: | + if ! [ -d /opt/homebrew/opt/openssl@1.1 ]; then + brew install "openssl@1.1" + fi + if ! type -f gpg &> /dev/null; then + brew install gnupg + fi + if ! [ -f "$HOME/.cargo/bin/rustup" ]; then + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + fi - - uses: actions/checkout@v2 - - name: Set Env - run: | - export GIT_TAG_NAME=` echo ${{ github.ref }} | awk -F '/' '{print $4}' ` - echo "GIT_TAG_NAME=$GIT_TAG_NAME" >> $GITHUB_ENV - - name: Build and package ckb-cli - env: - LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }} - GPG_SIGNER: ${{ secrets.GPG_SIGNER }} - run: | - export GIT_TAG_NAME=` echo ${{ github.ref }} | awk -F '/' '{print $4}' ` - make prod - gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output devtools/ci/signer.asc devtools/ci/signer.asc.gpg - gpg --import devtools/ci/signer.asc - devtools/ci/package.sh target/release/ckb-cli - mv ${{ github.workspace }}/releases/ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }} ${{ github.workspace }} - mv ${{ github.workspace }}/releases/ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc ${{ github.workspace }} - - name: upload-zip-file - uses: actions/upload-artifact@v2 - with: - name: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }} - path: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }} - - name: upload-asc-file - uses: actions/upload-artifact@v2 - with: - name: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc - path: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc + - uses: actions/checkout@v4 + - name: Set Env + run: | + export GIT_TAG_NAME=` echo ${{ github.ref }} | awk -F '/' '{print $4}' ` + echo "GIT_TAG_NAME=$GIT_TAG_NAME" >> $GITHUB_ENV + - name: Build and package ckb-cli + env: + LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }} + GPG_SIGNER: ${{ secrets.GPG_SIGNER }} + run: | + export GIT_TAG_NAME=` echo ${{ github.ref }} | awk -F '/' '{print $4}' ` + make prod + gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output devtools/ci/signer.asc devtools/ci/signer.asc.gpg + gpg --import devtools/ci/signer.asc + devtools/ci/package.sh target/release/ckb-cli + mv ${{ github.workspace }}/releases/ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }} ${{ github.workspace }} + mv ${{ github.workspace }}/releases/ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc ${{ github.workspace }} + - name: upload-zip-file + uses: actions/upload-artifact@v4 + with: + name: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }} + path: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }} + - name: upload-asc-file + uses: actions/upload-artifact@v4 + with: + name: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc + path: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc env: REL_PKG: aarch64-apple-darwin.zip @@ -238,51 +238,51 @@ jobs: name: package-for-windows runs-on: windows-2019 steps: - - name: Install Dependencies - run: | - iwr -useb get.scoop.sh -outfile 'install-scoop.ps1' - .\install-scoop.ps1 -RunAsAdmin - echo "LIBCLANG_PATH=$($HOME)/scoop/apps/llvm/current/bin" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - echo "$env:USERPROFILE\scoop\shims" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - scoop install llvm yasm + - name: Install Dependencies + run: | + iwr -useb get.scoop.sh -outfile 'install-scoop.ps1' + .\install-scoop.ps1 -RunAsAdmin + echo "LIBCLANG_PATH=$($HOME)/scoop/apps/llvm/current/bin" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + echo "$env:USERPROFILE\scoop\shims" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + scoop install llvm yasm - echo ("GIT_TAG_NAME=" + $env:GITHUB_REF.replace('refs/heads/pkg/', '')) >> $env:GITHUB_ENV - echo "$env:USERPROFILE\scoop\shims" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - echo "C:\msys64\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - echo "LIBCLANG_PATH=$env:USERPROFILE\scoop\apps\llvm\current\bin" >> $env:GITHUB_ENV - - uses: actions/checkout@v2 - - name: Build - run: | - make prod - - name: Prepare archive - run: | - $env:GIT_TAG_NAME=($env:GITHUB_REF -split '/')[3] - mkdir ckb-cli_$($env:GIT_TAG_NAME)_x86_64-pc-windows-msvc - cp -r target/release/ckb-cli.exe,README.md,CHANGELOG.md,COPYING ckb-cli_$($env:GIT_TAG_NAME)_x86_64-pc-windows-msvc - - name: Archive Files - run: | - $env:GIT_TAG_NAME=($env:GITHUB_REF -split '/')[3] - Compress-Archive -Path ckb-cli_$($env:GIT_TAG_NAME)_x86_64-pc-windows-msvc -DestinationPath ckb-cli_$($env:GIT_TAG_NAME)_$($env:REL_PKG) - - name: Sign Archive - env: - LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }} - GPG_SIGNER: ${{ secrets.GPG_SIGNER }} - run: | - $CYGPWD = cygpath -u (Get-Location) - gpg --quiet --batch --yes --decrypt --passphrase="$env:LARGE_SECRET_PASSPHRASE" --output "$CYGPWD/devtools/ci/signer.asc" "$CYGPWD/devtools/ci/signer.asc.gpg" - gpg --import "$CYGPWD/devtools/ci/signer.asc" - $env:GIT_TAG_NAME=($env:GITHUB_REF -split '/')[3] - gpg -u "$env:GPG_SIGNER" -ab "$CYGPWD/ckb-cli_$($env:GIT_TAG_NAME)_$($env:REL_PKG)" - - name: upload-artifact - uses: actions/upload-artifact@v2 - with: - name: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }} - path: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }} - - name: upload-artifact - uses: actions/upload-artifact@v2 - with: - name: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc - path: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc + echo ("GIT_TAG_NAME=" + $env:GITHUB_REF.replace('refs/heads/pkg/', '')) >> $env:GITHUB_ENV + echo "$env:USERPROFILE\scoop\shims" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + echo "C:\msys64\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + echo "LIBCLANG_PATH=$env:USERPROFILE\scoop\apps\llvm\current\bin" >> $env:GITHUB_ENV + - uses: actions/checkout@v4 + - name: Build + run: | + make prod + - name: Prepare archive + run: | + $env:GIT_TAG_NAME=($env:GITHUB_REF -split '/')[3] + mkdir ckb-cli_$($env:GIT_TAG_NAME)_x86_64-pc-windows-msvc + cp -r target/release/ckb-cli.exe,README.md,CHANGELOG.md,COPYING ckb-cli_$($env:GIT_TAG_NAME)_x86_64-pc-windows-msvc + - name: Archive Files + run: | + $env:GIT_TAG_NAME=($env:GITHUB_REF -split '/')[3] + Compress-Archive -Path ckb-cli_$($env:GIT_TAG_NAME)_x86_64-pc-windows-msvc -DestinationPath ckb-cli_$($env:GIT_TAG_NAME)_$($env:REL_PKG) + - name: Sign Archive + env: + LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }} + GPG_SIGNER: ${{ secrets.GPG_SIGNER }} + run: | + $CYGPWD = cygpath -u (Get-Location) + gpg --quiet --batch --yes --decrypt --passphrase="$env:LARGE_SECRET_PASSPHRASE" --output "$CYGPWD/devtools/ci/signer.asc" "$CYGPWD/devtools/ci/signer.asc.gpg" + gpg --import "$CYGPWD/devtools/ci/signer.asc" + $env:GIT_TAG_NAME=($env:GITHUB_REF -split '/')[3] + gpg -u "$env:GPG_SIGNER" -ab "$CYGPWD/ckb-cli_$($env:GIT_TAG_NAME)_$($env:REL_PKG)" + - name: upload-artifact + uses: actions/upload-artifact@v4 + with: + name: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }} + path: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }} + - name: upload-artifact + uses: actions/upload-artifact@v4 + with: + name: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc + path: ckb-cli_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc env: REL_PKG: x86_64-pc-windows-msvc.zip @@ -307,34 +307,34 @@ jobs: - package-for-windows - package-for-centos steps: - - uses: actions/checkout@v2 - - name: Set tag - run: | - export GIT_TAG_NAME=` echo ${{ github.ref }} | awk -F '/' '{print $4}' ` - echo "GIT_TAG_NAME=$GIT_TAG_NAME" >> $GITHUB_ENV - - name: Prepare - Download tar - uses: actions/download-artifact@v2 - with: - name: ckb-cli_${{env.GIT_TAG_NAME}}_${{ matrix.REL_PKG }} - - name: Prepare - Download asc - uses: actions/download-artifact@v2 - with: - name: ckb-cli_${{env.GIT_TAG_NAME}}_${{ matrix.REL_PKG }}.asc - - name: Upload tar assets - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.create-release.outputs.upload_url }} - asset_name: ckb-cli_${{env.GIT_TAG_NAME}}_${{ matrix.REL_PKG }} - asset_path: ${{ github.workspace }}/ckb-cli_${{env.GIT_TAG_NAME }}_${{ matrix.REL_PKG }} - asset_content_type: application/octet-stream - - name: Upload asc assets - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.create-release.outputs.upload_url }} - asset_name: ckb-cli_${{env.GIT_TAG_NAME}}_${{ matrix.REL_PKG }}.asc - asset_path: ${{ github.workspace }}/ckb-cli_${{env.GIT_TAG_NAME }}_${{ matrix.REL_PKG }}.asc - asset_content_type: application/octet-stream + - uses: actions/checkout@v4 + - name: Set tag + run: | + export GIT_TAG_NAME=` echo ${{ github.ref }} | awk -F '/' '{print $4}' ` + echo "GIT_TAG_NAME=$GIT_TAG_NAME" >> $GITHUB_ENV + - name: Prepare - Download tar + uses: actions/download-artifact@v4 + with: + name: ckb-cli_${{env.GIT_TAG_NAME}}_${{ matrix.REL_PKG }} + - name: Prepare - Download asc + uses: actions/download-artifact@v4 + with: + name: ckb-cli_${{env.GIT_TAG_NAME}}_${{ matrix.REL_PKG }}.asc + - name: Upload tar assets + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.create-release.outputs.upload_url }} + asset_name: ckb-cli_${{env.GIT_TAG_NAME}}_${{ matrix.REL_PKG }} + asset_path: ${{ github.workspace }}/ckb-cli_${{env.GIT_TAG_NAME }}_${{ matrix.REL_PKG }} + asset_content_type: application/octet-stream + - name: Upload asc assets + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.create-release.outputs.upload_url }} + asset_name: ckb-cli_${{env.GIT_TAG_NAME}}_${{ matrix.REL_PKG }}.asc + asset_path: ${{ github.workspace }}/ckb-cli_${{env.GIT_TAG_NAME }}_${{ matrix.REL_PKG }}.asc + asset_content_type: application/octet-stream