-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move release deployment script from Travis to GitHub actions
- Loading branch information
Showing
4 changed files
with
126 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
branches: | ||
- rvl/release-scripts | ||
- master | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
release: | ||
if: ${{ github.ref == 'refs/heads/rvl/release-scripts' || startsWith(github.ref, 'refs/tags/v') }} | ||
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' | ||
|
||
docs: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: '📥 Checkout repository' | ||
uses: actions/checkout@v1 | ||
|
||
- name: '📸 Build Documentation' | ||
run: | | ||
if [[ $GITHUB_REF =~ ^refs/tags/v ]]; then | ||
tag="${GITHUB_REF/refs\/tags\//}" | ||
else | ||
tag="" | ||
fi | ||
./scripts/update-docs.sh _build $tag | ||
- name: '📘 Publish' | ||
if: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v') }} | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.WILLIAM_KING_TOKEN }} | ||
enable_jekyll: false | ||
publish_dir: _build | ||
keep_files: true | ||
|
||
bump_sh: | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: '📥 Checkout repository' | ||
uses: actions/checkout@v1 | ||
- name: 'Set up Ruby' | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 2.7 | ||
- name: 'Install gems' | ||
run: 'gem install bump-cli' | ||
- name: 'Install dependencies' | ||
run: 'sudo snap install yq' | ||
- name: 'Update Release in Bump.sh' | ||
run: './scripts/update-bump.sh' | ||
env: | ||
BUMP_SH_DOC_ID: ${{ secrets.BUMP_SH_DOC_ID }} | ||
BUMP_SH_TOKEN: ${{ secrets.BUMP_SH_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
# Needs yq version 4 and the bump-cli ruby gem | ||
|
||
set -euo pipefail | ||
|
||
if [ -z "${BUMP_SH_DOC_ID:-}" ] || [ -z "${BUMP_SH_TOKEN:-}" ]; then | ||
echo "BUMP_SH_DOC_ID or BUMP_SH_TOKEN variables not set" > /dev/stderr | ||
exit 1 | ||
fi | ||
|
||
bump_swagger() { | ||
bump "$1" --doc "$BUMP_SH_DOC_ID" --token "$BUMP_SH_TOKEN" specifications/api/swagger.json | ||
} | ||
|
||
yq eval specifications/api/swagger.yaml -j > specifications/api/swagger.json | ||
|
||
bump_swagger validate | ||
bump_swagger deploy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
root=$(cd "$(dirname "$0")"/..; pwd) | ||
out="${1:-}" | ||
tag="${2:-}" | ||
|
||
if [ -z "$out" ]; then | ||
echo "usage: $0 DEST_DIR [TAG]" | ||
exit 1 | ||
fi | ||
|
||
if [ -n "$tag" ]; then | ||
what="release tag $tag" | ||
dest="$out/api/$tag" | ||
else | ||
what="git snapshot" | ||
dest="$out/api/edge" | ||
fi | ||
|
||
echo '*** Building documentation for' "$what" | ||
mkdir -p "$dest" | ||
cp -Rv "$root"/specifications/api/* "$dest" |