diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 00000000..8ad72fe0 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,78 @@ +name: CI workflow + +on: + pull_request: + types: [ opened, synchronize, reopened ] + push: + branches: + - "develop" + - "master" + - "pkg/*" + +env: + CARGO_TERM_COLOR: always + RUST_BACKTRACE: full + +jobs: + unit-test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + steps: + - uses: actions/checkout@v2 + - if: matrix.os == 'windows-latest' + name: Windows Dependencies + run: | + Set-ExecutionPolicy RemoteSigned -scope CurrentUser + Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh') + scoop install yasm + echo ("PATH=" + $env:PATH + ";" + $env:USERPROFILE + "\scoop\shims;C:\msys64\mingw64\bin") >> $env:GITHUB_ENV + - name: UnitTest + run: make test + + integration-test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + steps: + - uses: actions/checkout@v2 + - name: Integration_Test + run: make integration + + linters: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + steps: + - uses: actions/checkout@v2 + - name: Linters + run: | + cargo fmt --version || rustup component add rustfmt + cargo clippy --version || rustup component add clippy + make fmt + make clippy + git diff --exit-code Cargo.lock + + security-audit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Security Audit & Licenses + run: | + rustup toolchain install nightly --allow-downgrade --profile minimal + make security-audit + + ci-success: + name: ci + needs: + - unit-test + - integration-test + - linters + - security-audit + runs-on: ubuntu-latest + steps: + - name: CI succeeded + run: exit 0 diff --git a/.github/workflows/package.yaml b/.github/workflows/package.yaml new file mode 100644 index 00000000..8802e6e8 --- /dev/null +++ b/.github/workflows/package.yaml @@ -0,0 +1,239 @@ +name: Package + +concurrency: + group: package-${{ github.ref }} + cancel-in-progress: true + +on: + push: + branches: + - 'pkg/*' + +env: + CARGO_TERM_COLOR: always + RUST_BACKTRACE: full + +jobs: + create-release: + name: Create release + runs-on: ubuntu-latest + outputs: + upload_url: ${{ steps.create-release.outputs.upload_url }} + 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: Create release + id: create-release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ env.GIT_TAG_NAME}} + release_name: ${{ env.GIT_TAG_NAME}} + draft: true + prerelease: true + + package-for-linux: + 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}' ` + mkdir -p $HOME/.cargo + docker run --rm -i -w /ckb-cli -v $(pwd):/ckb-cli -v $HOME/.cargo:/root/.cargo -e OPENSSL_STATIC=1 -e OPENSSL_LIB_DIR=/usr/local/lib -e OPENSSL_INCLUDE_DIR=/usr/local/include/openssl $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 + env: + BUILDER_IMAGE: nervos/ckb-docker-builder:xenial-rust-1.51.0 + REL_PKG: x86_64-unknown-linux-gnu.tar.gz + + package-for-centos: + 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}' ` + mkdir -p $HOME/.cargo + docker run --rm -i -w /ckb-cli -v $(pwd):/ckb-cli -v $HOME/.cargo:/root/.cargo $BUILDER_IMAGE scl enable llvm-toolset-7 '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 + env: + BUILDER_IMAGE: nervos/ckb-docker-builder:centos-7-rust-1.51.0 + REL_PKG: x86_64-unknown-centos-gnu.tar.gz + + package-for-mac: + name: package-for-mac + runs-on: macos-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}' ` + make OPENSSL_STATIC=1 OPENSSL_LIB_DIR=/usr/local/opt/openssl@1.1/lib OPENSSL_INCLUDE_DIR=/usr/local/opt/openssl@1.1/include 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 + env: + REL_PKG: x86_64-apple-darwin.zip + + package-for-windows: + name: package-for-windows + runs-on: windows-latest + steps: + - name: Install Dependencies + run: | + Set-ExecutionPolicy RemoteSigned -scope CurrentUser + Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh') + scoop install yasm + echo ("GIT_TAG_NAME=" + $env:GITHUB_REF.replace('refs/heads/pkg/', '')) >> $env:GITHUB_ENV + echo ("PATH=" + $env:PATH + ";" + $env:USERPROFILE + "\scoop\shims;C:\msys64\mingw64\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 + env: + REL_PKG: x86_64-pc-windows-msvc.zip + + Upload_File: + name: Upload_Zip_File + runs-on: ubuntu-latest + strategy: + matrix: + include: + - REL_PKG: x86_64-unknown-linux-gnu.tar.gz + - REL_PKG: x86_64-unknown-centos-gnu.tar.gz + - REL_PKG: x86_64-apple-darwin.zip + - REL_PKG: x86_64-pc-windows-msvc.zip + needs: + - create-release + - package-for-linux + - package-for-mac + - 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 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5710d071..00000000 --- a/.travis.yml +++ /dev/null @@ -1,133 +0,0 @@ -language: rust -rust: 1.46.0 -dist: xenial -sudo: true -cache: - cargo: true - timeout: 1024 - -git: - depth: 2 - submodules: false - -env: - global: - - RUST_BACKTRACE=full - -addons: - apt: - packages: - - libssl-dev - - autoconf - - flex - - bison - - texinfo - - libtool - -before_install: - - cargo sweep --version || travis_retry cargo install --git https://github.com/holmgr/cargo-sweep --rev 4770deda37a2203c783e301b8c0c895964e8971e - - cargo sweep -s - -before_script: - - if [ "$TRAVIS_OS_NAME" = "osx" ]; then ulimit -n 8192; fi - -script: make test - -before_cache: - - rm -rf ./target/release/incremental/ - - rm -rf ./target/debug/incremental/ - - cargo sweep -f - -before_deploy: - - 'export TRAVIS_TAG="${TRAVIS_BRANCH##*/}"' - - git tag $TRAVIS_TAG -deploy: - provider: releases - api_key: "$GITHUB_TOKEN" - file: - - "releases/ckb-cli_${TRAVIS_TAG}_${REL_PKG}" - - "releases/ckb-cli_${TRAVIS_TAG}_${REL_PKG}.asc" - skip_cleanup: true - draft: true - overwrite: true - on: - all_branches: true - condition: '$TRAVIS_BRANCH =~ ^pkg/' - -matrix: - include: - # We don't run tests, linters and quck check in fork branch, since they will be covered in PR. - - name: Tests on macOS - if: 'tag IS NOT present AND (type = pull_request OR branch = master)' - os: osx - - name: Tests on Linux - if: 'tag IS NOT present AND (type = pull_request OR branch = master)' - os: linux - - name: Linters - env: CACHE_NAME=linters - if: 'tag IS NOT present AND (type = pull_request OR branch = master)' - os: linux - install: - - cargo fmt --version || travis_retry rustup component add rustfmt - - cargo clippy --version || travis_retry rustup component add clippy - script: - - make fmt - - make clippy - - git diff --exit-code Cargo.lock - - name: Security Audit - if: 'tag IS NOT present AND (type = pull_request OR branch = master)' - os: linux - rust: nightly - script: make security-audit - - name: PR Integration - if: 'tag IS NOT present AND (type = pull_request OR branch = master)' - os: linux - script: make integration - - - name: Package for macOS - if: 'branch =~ /^pkg\// AND env(GITHUB_TOKEN) IS present' - os: osx - env: REL_PKG=x86_64-apple-darwin.zip - before_install: skip - cache: - directories: - - $HOME/.cargo - before_cache: - - rm -rf $HOME/.cargo/registry - script: - - make OPENSSL_STATIC=1 OPENSSL_LIB_DIR=/usr/local/opt/openssl@1.1/lib OPENSSL_INCLUDE_DIR=/usr/local/opt/openssl@1.1/include prod - - openssl aes-256-cbc -K $encrypted_2e21ee7c4b13_key -iv $encrypted_2e21ee7c4b13_iv -in devtools/ci/travis-secret.asc.enc -out devtools/ci/travis-secret.asc -d - - gpg --import devtools/ci/travis-secret.asc - - devtools/ci/package.sh target/release/ckb-cli - - name: Package for Linux - if: 'branch =~ /^pkg\// AND env(GITHUB_TOKEN) IS present' - language: ruby - addons: { apt: { packages: [] } } - env: REL_PKG=x86_64-unknown-linux-gnu.tar.gz BUILDER_IMAGE=nervos/ckb-docker-builder:xenial-rust-1.46.0 - before_install: skip - before_cache: skip - cache: - directories: - - $HOME/.cargo/git - script: - - mkdir -p $HOME/.cargo/git - - docker run --rm -it -w /ckb-cli -v $(pwd):/ckb-cli -v $HOME/.cargo/git:/root/.cargo/git -e OPENSSL_STATIC=1 -e OPENSSL_LIB_DIR=/usr/local/lib -e OPENSSL_INCLUDE_DIR=/usr/local/include/openssl $BUILDER_IMAGE make prod - - openssl aes-256-cbc -K $encrypted_2e21ee7c4b13_key -iv $encrypted_2e21ee7c4b13_iv -in devtools/ci/travis-secret.asc.enc -out devtools/ci/travis-secret.asc -d - - gpg --import devtools/ci/travis-secret.asc - - devtools/ci/package.sh target/release/ckb-cli - - name: Package for Centos - if: 'branch =~ /^pkg\// AND env(GITHUB_TOKEN) IS present' - language: ruby - addons: { apt: { packages: [] } } - env: REL_PKG=x86_64-unknown-centos-gnu.tar.gz BUILDER_IMAGE=nervos/ckb-docker-builder:centos-7-rust-1.46.0 - before_install: skip - before_cache: skip - cache: - directories: - - $HOME/.cargo/git - script: - - mkdir -p $HOME/.cargo/git - - docker run --rm -it -w /ckb-cli -v $(pwd):/ckb-cli -v $HOME/.cargo/git:/root/.cargo/git $BUILDER_IMAGE scl enable llvm-toolset-7 'make prod' - - openssl aes-256-cbc -K $encrypted_2e21ee7c4b13_key -iv $encrypted_2e21ee7c4b13_iv -in devtools/ci/travis-secret.asc.enc -out devtools/ci/travis-secret.asc -d - - gpg --import devtools/ci/travis-secret.asc - - devtools/ci/package.sh target/release/ckb-cli diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 4c3ff2aa..00000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,75 +0,0 @@ -trigger: - branches: - include: - - '*' - tags: - exclude: - - '*' - -jobs: - - job: UnitTest - condition: | - and( - not(startsWith(variables['Build.SourceBranch'], 'refs/tags/')), - or( - eq(variables['Build.Reason'], 'PullRequest'), - eq(variables['Build.SourceBranch'], 'refs/heads/master') - ) - ) - pool: - vmImage: 'VS2017-Win2016' - steps: - - template: devtools/azure/windows-dependencies.yml - parameters: - rustup_toolchain: '1.46.0-x86_64-pc-windows-msvc' - - script: make test - displayName: Run unit tests - env: - CI: true - - - job: Package - timeoutInMinutes: 0 - condition: startsWith(variables['Build.SourceBranch'], 'refs/heads/pkg/') - pool: - vmImage: 'VS2017-Win2016' - steps: - - template: devtools/azure/windows-dependencies.yml - parameters: - rustup_toolchain: '1.46.0-x86_64-pc-windows-msvc' - - script: make prod - displayName: Build - - powershell: | - mkdir ckb-cli_$(Build.SourceBranchName)_x86_64-pc-windows-msvc - cp -r target/release/ckb-cli.exe,README.md,CHANGELOG.md,COPYING ckb-cli_$(Build.SourceBranchName)_x86_64-pc-windows-msvc - displayName: Prepare archive - - task: ArchiveFiles@2 - inputs: - rootFolderOrFile: 'ckb-cli_$(Build.SourceBranchName)_x86_64-pc-windows-msvc' - archiveFile: '$(Build.ArtifactStagingDirectory)/ckb-cli_$(Build.SourceBranchName)_x86_64-pc-windows-msvc.zip' - - script: | - scoop bucket add extras - scoop install gpg4win - displayName: Install GPG4Win - - task: DownloadSecureFile@1 - inputs: - secureFile: azure-secret.asc - - script: | - set PATH=%PATH%;%ProgramFiles(x86)%/GnuPG/bin - gpg --import %DOWNLOADSECUREFILE_SECUREFILEPATH% - echo "##vso[task.setvariable variable=PATH;]%PATH%;%ProgramFiles(x86)%/GnuPG/bin" - displayName: Setup GPG - - script: | - gpg -u "Nervos Azure Builder " -ab "$(Build.ArtifactStagingDirectory)/ckb-cli_$(Build.SourceBranchName)_x86_64-pc-windows-msvc.zip" - displayName: Sign Archive - - task: GitHubRelease@0 - inputs: - gitHubConnection: nervos-bot - repositoryName: nervosnetwork/ckb-cli - action: edit - tag: $(Build.SourceBranchName) - assets: | - $(Build.ArtifactStagingDirectory)/*.zip - $(Build.ArtifactStagingDirectory)/*.asc - assetUploadMode: replace - isDraft: true - addChangeLog: false diff --git a/devtools/azure/windows-dependencies.yml b/devtools/azure/windows-dependencies.yml deleted file mode 100644 index aa2bfa48..00000000 --- a/devtools/azure/windows-dependencies.yml +++ /dev/null @@ -1,26 +0,0 @@ -parameters: - rustup_toolchain: '' -steps: -- powershell: Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh') - displayName: Install scoop -- script: | - set PATH=%PATH%;%USERPROFILE%\scoop\shims - echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\scoop\shims" - scoop help - displayName: Add scoop to path -- script: scoop install llvm - displayName: Install LLVM -- script: scoop install yasm - displayName: Install yasm -- script: | - curl -sSf -o rustup-init.exe https://win.rustup.rs - rustup-init.exe -y --default-host ${{ parameters.rustup_toolchain }} - set PATH=%PATH%;%USERPROFILE%\.cargo\bin - echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin" - displayName: Install rust -- script: | - rustc --version - cargo --version - clang --version - yasm --version - displayName: Test/query binaries diff --git a/devtools/ci/package.sh b/devtools/ci/package.sh index 97cd11ad..033272b9 100755 --- a/devtools/ci/package.sh +++ b/devtools/ci/package.sh @@ -1,13 +1,7 @@ #!/bin/bash set -eu -if [ -z "${TRAVIS_TAG:-}" ]; then - if [ -n "${TRAVIS_BRANCH}" ]; then - TRAVIS_TAG="${TRAVIS_BRANCH##*/}" - else - TRAVIS_TAG="$(git describe)" - fi -fi +GIT_TAG_NAME="${GIT_TAG_NAME:-"$(git describe)"}" if [ -z "${REL_PKG:-}" ]; then if [ "$(uname)" = Darwin ]; then REL_PKG=x86_64-apple-darwin.zip @@ -16,9 +10,8 @@ if [ -z "${REL_PKG:-}" ]; then fi fi -PKG_NAME="ckb-cli_${TRAVIS_TAG}_${REL_PKG%%.*}" -ARCHIVE_NAME="ckb-cli_${TRAVIS_TAG}_${REL_PKG}" - +PKG_NAME="ckb-cli_${GIT_TAG_NAME}_${REL_PKG%%.*}" +ARCHIVE_NAME="ckb-cli_${GIT_TAG_NAME}_${REL_PKG}" echo "ARCHIVE_NAME=$ARCHIVE_NAME" rm -rf releases diff --git a/devtools/ci/signer.asc.gpg b/devtools/ci/signer.asc.gpg new file mode 100644 index 00000000..af2311d6 Binary files /dev/null and b/devtools/ci/signer.asc.gpg differ diff --git a/devtools/ci/travis-secret.asc.enc b/devtools/ci/travis-secret.asc.enc deleted file mode 100644 index ac70e0dd..00000000 Binary files a/devtools/ci/travis-secret.asc.enc and /dev/null differ