v0.8.2 #16
Workflow file for this run
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
name: cd | |
on: | |
release: | |
types: [published] | |
workflow_dispatch: | |
jobs: | |
update-download-redirect: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: gh-pages | |
- name: generate download.html | |
id: meta | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
url=$(gh release view --json assets | jq -r '.assets[]? | select(.name | endswith(".dmg")) | .url') | |
v=$(gh release view --json tagName --jq .tagName) | |
echo "::set-output name=v::$v" | |
cat <<-EOS > download.html | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="refresh" content="0; URL='$url'"> | |
<title>Downloading teaBASE-$v.dmg…</title> | |
</head> | |
<body> | |
<p>Downloading <a href="$url">$url</a>…</p> | |
</body> | |
</html> | |
EOS | |
- uses: fregante/setup-git-user@v2 | |
- run: | | |
git add download.html | |
git commit --message 'Update download.html for ${{ steps.meta.outputs.v }}' | |
git push origin gh-pages |