Skip to content

Commit

Permalink
chore: publish using draft release
Browse files Browse the repository at this point in the history
  • Loading branch information
doitian committed Nov 17, 2020
1 parent 8db7f86 commit 619f97a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
15 changes: 9 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,21 @@ before_cache:
- 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
prerelease: true
draft: true
overwrite: true
on:
tags: true
condition: '"$GITHUB_TOKEN" != "" && "$REL_PKG" != ""'
all_branches: true
condition: '$TRAVIS_BRANCH =~ ^pkg/'

matrix:
include:
Expand Down Expand Up @@ -82,7 +85,7 @@ matrix:
script: make integration

- name: Package for macOS
if: 'tag IS present AND env(GITHUB_TOKEN) IS present'
if: 'branch =~ /^pkg\// AND env(GITHUB_TOKEN) IS present'
os: osx
env: REL_PKG=x86_64-apple-darwin.zip
before_install: skip
Expand All @@ -97,7 +100,7 @@ matrix:
- gpg --import devtools/ci/travis-secret.asc
- devtools/ci/package.sh target/release/ckb-cli
- name: Package for Linux
if: 'tag IS present AND env(GITHUB_TOKEN) IS present'
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
Expand All @@ -113,7 +116,7 @@ matrix:
- gpg --import devtools/ci/travis-secret.asc
- devtools/ci/package.sh target/release/ckb-cli
- name: Package for Centos
if: 'tag IS present AND env(GITHUB_TOKEN) IS present'
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
Expand Down
6 changes: 3 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ trigger:
include:
- '*'
tags:
include:
exclude:
- '*'

jobs:
Expand All @@ -29,7 +29,7 @@ jobs:

- job: Package
timeoutInMinutes: 0
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
condition: startsWith(variables['Build.SourceBranch'], 'refs/heads/pkg/')
pool:
vmImage: 'VS2017-Win2016'
steps:
Expand Down Expand Up @@ -71,5 +71,5 @@ jobs:
$(Build.ArtifactStagingDirectory)/*.zip
$(Build.ArtifactStagingDirectory)/*.asc
assetUploadMode: replace
isPreRelease: true
isDraft: true
addChangeLog: false
10 changes: 9 additions & 1 deletion devtools/ci/package.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
#!/bin/bash
set -eu

TRAVIS_TAG="${TRAVIS_TAG:-"$(git describe)"}"
if [ -z "${TRAVIS_TAG:-}" ]; then
if [ -n "${TRAVIS_BRANCH}" ]; then
TRAVIS_TAG="${TRAVIS_BRANCH##*/}"
else
TRAVIS_TAG="$(git describe)"
fi
fi
if [ -z "${REL_PKG:-}" ]; then
if [ "$(uname)" = Darwin ]; then
REL_PKG=x86_64-apple-darwin.zip
Expand All @@ -13,6 +19,8 @@ fi
PKG_NAME="ckb-cli_${TRAVIS_TAG}_${REL_PKG%%.*}"
ARCHIVE_NAME="ckb-cli_${TRAVIS_TAG}_${REL_PKG}"

echo "ARCHIVE_NAME=$ARCHIVE_NAME"

rm -rf releases
mkdir releases

Expand Down

0 comments on commit 619f97a

Please sign in to comment.