Skip to content

Commit

Permalink
Move release deployment script from Travis to GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
rvl committed Apr 29, 2021
1 parent a0c5b70 commit 35cdbca
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 44 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: release

on:
push:
branches:
- 'rvl/release-scripts'
tags:
- 'v*'

jobs:
release:
runs-on: ubuntu-20.04
steps:
- name: '❄ Wait for Hydra build'
uses: rvl/hydra-build-products-action@master
id: hydra
with:
hydra: 'https://hydra.iohk.io'
jobs: 'cardano-wallet-linux64 cardano-wallet-macos64 cardano-wallet-win64'

- name: '🍒 Fetch release files'
run: |
for url in ${{ steps.hydra.outputs.buildProducts }}; do
wget $url
done
- name: '🚀 Release'
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
uses: docker://antonyurchenko/git-release:v3.4.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DRAFT_RELEASE: "true"
PRE_RELEASE: "false"
# CHANGELOG_FILE: "ChangeLog.md"
# ALLOW_EMPTY_CHANGELOG: "false"
ALLOW_TAG_PREFIX: "true"
with:
args: '*.tar.gz *.zip'
45 changes: 1 addition & 44 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:

- stage: deploy 🚀
if: type != pull_request AND (tag =~ ^v OR commit_message =~ /TRAVIS_TRIGGER_RELEASE/)
name: "Executables"
name: "Release Documentation"
script:
# Upload swagger to bump.sh
- gem install bump-cli
Expand All @@ -56,53 +56,10 @@ jobs:
- bump validate --doc $BUMP_SH_DOC_ID --token $BUMP_SH_TOKEN specifications/api/swagger.json
- bump deploy --doc $BUMP_SH_DOC_ID --token $BUMP_SH_TOKEN specifications/api/swagger.json

# Fetch the builds from Hydra
- nvm install 12.18.3 && nvm use 12.18.3
- npm install --no-save axios@0.19.2 lodash@4.17.20
- node --tls-min-v1.2 scripts/travis-download-builds.js

# Unpack and rename stuff for the Linux archive
- "tar xzf cardano-wallet-20*-linux64.tar.gz"
- "mv cardano-wallet-20*/ cardano-wallet-linux64"
- "./cardano-wallet-linux64/cardano-wallet version | grep -q $TRAVIS_COMMIT"
- "mkdir -p auto-completion auto-completion/bash auto-completion/zsh auto-completion/fish"
- "./cardano-wallet-linux64/cardano-wallet --bash-completion-script cardano-wallet > auto-completion/bash/cardano-wallet.sh"
- "./cardano-wallet-linux64/cardano-wallet --zsh-completion-script cardano-wallet > auto-completion/zsh/_cardano-wallet"
- "./cardano-wallet-linux64/cardano-wallet --fish-completion-script cardano-wallet > auto-completion/fish/cardano-wallet.fish"
- "cp -r auto-completion cardano-wallet-linux64"
- "tar czf cardano-wallet-$TRAVIS_TAG-linux64.tar.gz cardano-wallet-linux64"
- "rm -rf cardano-wallet-linux64 cardano-wallet-20*-linux64.tar.gz"

# Unpack and rename stuff for the MacOS archive
- "tar xzf cardano-wallet-20*-macos64.tar.gz"
- "mv cardano-wallet-20*/ cardano-wallet-macos64"
- "cp -r auto-completion cardano-wallet-macos64"
- "tar czf cardano-wallet-$TRAVIS_TAG-macos64.tar.gz cardano-wallet-macos64"
- "rm -rf cardano-wallet-macos64 cardano-wallet-20*-macos64.tar.gz"

# Unpack and rename stuff for the Windows archive
- "unzip -d cardano-wallet-win64 cardano-wallet-20*-win64.zip"
- "zip -r cardano-wallet-$TRAVIS_TAG-win64.zip cardano-wallet-win64"
- "rm -rf cardano-wallet-win64 cardano-wallet-win64.zip"

# Deploy documentation snapshot
- mkdir -p api/$TRAVIS_TAG
- cp -Rv specifications/api/* api/$TRAVIS_TAG
- git checkout --orphan gh-pages-deploy && git reset
- git add api && git commit -m $TRAVIS_COMMIT
- git checkout gh-pages && git merge -X theirs --no-commit --no-ff --allow-unrelated-histories - && git commit --allow-empty --no-edit
- travis_retry git push -f -q https://WilliamKingNoel-Bot:$GITHUB_ACCESS_TOKEN@github.com/input-output-hk/cardano-wallet gh-pages &>/dev/null

deploy:
provider: releases
api_key: $GITHUB_ACCESS_TOKEN
draft: true # Allow editing the release before publishing it officially on GitHub
skip_cleanup: true # Make sure that files from the previous stages aren't cleaned up
file:
- cardano-wallet-$TRAVIS_TAG-linux64.tar.gz
- cardano-wallet-$TRAVIS_TAG-macos64.tar.gz
- cardano-wallet-$TRAVIS_TAG-win64.zip
on:
repo: input-output-hk/cardano-wallet
branch: master
tags: true # Only release when a tag is pushed

0 comments on commit 35cdbca

Please sign in to comment.