diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 000000000..252d05c5b --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,37 @@ +os: Visual Studio 2017 +version: '{build}' + +branches: + only: + - master + - /v[0-9.]+/ + +build_script: + - bash ci/publish-tarball.sh + +notifications: + - provider: Slack + incoming_webhook: + secure: 6HTXVh+FBz29LGJb+taFOo9dqoADfo9xyAszeyXZF5Ub9t5NERytKAR35B2wb+uIOOCBF8+JhmH4437Cgf/ti4IqvURzW1QReXK7eQhn1EI= + channel: ci-status + on_build_success: false + on_build_failure: true + on_build_status_changed: true + +deploy: + - provider: S3 + access_key_id: + secure: ptvqM/yvgeTeA12XOzybH1KYNh95AdfEvqoH9mvP2ic= + secret_access_key: + secure: IkrgBlz5hdxvwcJdMXyyHUrpWhKa6fXLOD/8rm/rjKqYCdrba9B8V1nLZVrzXGGy + bucket: release.solana.com + region: us-west-1 + set_public: true + + - provider: GitHub + auth_token: + secure: vQ3jMl5LQrit6+TQONA3ZgQjZ/Ej62BN2ReVb2NSOwjITHMu1131hjc3dOrMEZL6 + draft: false + prerelease: false + on: + appveyor_repo_tag: true diff --git a/.travis.yml b/.travis.yml index 349fef95c..6df05c5eb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,6 +34,6 @@ deploy: api_key: $GITHUB_TOKEN skip_cleanup: true file_glob: true - file: travis-$TRAVIS_TAG-upload/* + file: travis-release-upload/* on: tags: true diff --git a/ci/env.sh b/ci/env.sh index a651f336b..0ca4765f7 100644 --- a/ci/env.sh +++ b/ci/env.sh @@ -4,8 +4,9 @@ # |source| me # -if ${CI:-false}; then - if ${TRAVIS:-false}; then +if [[ -n $CI ]]; then + export CI=1 + if [[ -n $TRAVIS ]]; then export CI_BRANCH=$TRAVIS_BRANCH export CI_BUILD_ID=$TRAVIS_BUILD_ID export CI_COMMIT=$TRAVIS_COMMIT @@ -17,8 +18,7 @@ if ${CI:-false}; then fi export CI_OS_NAME=$TRAVIS_OS_NAME export CI_TAG=$TRAVIS_TAG - fi - if ${BUILDKITE:-false}; then + elif [[ -n $BUILDKITE ]]; then export CI_BRANCH=$BUILDKITE_BRANCH export CI_BUILD_ID=$BUILDKITE_BUILD_ID export CI_COMMIT=$BUILDKITE_COMMIT @@ -39,6 +39,22 @@ if ${CI:-false}; then else export CI_TAG=$BUILDKITE_TAG fi + elif [[ -n $APPVEYOR ]]; then + export CI_BRANCH=$APPVEYOR_REPO_BRANCH + export CI_BUILD_ID=$APPVEYOR_BUILD_ID + export CI_COMMIT=$APPVEYOR_REPO_COMMIT + export CI_JOB_ID=$APPVEYOR_JOB_ID + if [[ -n $APPVEYOR_PULL_REQUEST_NUMBER ]]; then + export CI_PULL_REQUEST=true + else + export CI_PULL_REQUEST= + fi + if [[ $CI_LINUX = True ]]; then + export CI_OS_NAME=linux + elif [[ $CI_WINDOWS = True ]]; then + export CI_OS_NAME=windows + fi + export CI_TAG=$APPVEYOR_REPO_TAG_NAME fi else export CI= diff --git a/ci/publish-tarball.sh b/ci/publish-tarball.sh index 6139bf113..be9778f8b 100755 --- a/ci/publish-tarball.sh +++ b/ci/publish-tarball.sh @@ -3,6 +3,18 @@ set -e cd "$(dirname "$0")/.." +if [[ -n $APPVEYOR ]]; then + # Bootstrap rust build environment + source ci/env.sh + source ci/rust-version.sh + + appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe + ./rustup-init -yv --default-toolchain $rust_stable --default-host x86_64-pc-windows-msvc + export PATH="$PATH:$USERPROFILE/.cargo/bin" + rustc -vV + cargo -vV +fi + DRYRUN= if [[ -z $CI_BRANCH ]]; then DRYRUN="echo" @@ -131,16 +143,19 @@ for file in solana-release-$TARGET.tar.bz2 solana-install-$TARGET; do ci/upload-github-release-asset.sh $file fi elif [[ -n $TRAVIS ]]; then - # .travis.yaml uploads everything in the travis-s3-upload/ directory to release.solana.com + # .travis.yml uploads everything in the s3-upload/ directory to release.solana.com mkdir -p travis-s3-upload/"$CHANNEL_OR_TAG" cp -v $file travis-s3-upload/"$CHANNEL_OR_TAG"/ if [[ -n $TAG ]]; then - # .travis.yaml uploads everything in the travis-$TAG-upload/ directory to + # .travis.yaml uploads everything in the release-upload/ directory to # the associated Github Release - mkdir -p travis-"$TAG"-upload/ - cp -v $file travis-"$TAG"-upload/ + mkdir -p travis-release-upload/ + cp -v $file travis-release-upload/ fi + elif [[ -n $APPVEYOR ]]; then + # Add artifacts for .appveyor.yml to upload + appveyor PushArtifact $file -FileName "$CHANNEL_OR_TAG"/$file fi done