Merge pull request #233 from ericzbeard/fix-208 #31
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
on: | |
push: | |
tags: | |
- 'v*' | |
name: Create release from tag | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
container: golang:latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: | | |
apt-get update | |
apt-get install -y zip | |
- name: Build | |
run: ./.github/workflows/build.sh | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: dist | |
path: ./dist/*.zip | |
release: | |
name: Release | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- uses: actions/download-artifact@v2 | |
with: | |
name: dist | |
path: dist | |
- run: | | |
set -x | |
(echo "${GITHUB_REF##*/}"; echo; git cherry -v "$(git describe --abbrev=0 HEAD^)" | cut -d" " -f3-) > CHANGELOG | |
assets=() | |
for zip in ./dist/*.zip; do | |
assets+=("$zip") | |
done | |
gh release upload "${GITHUB_REF##*/}" "${assets[@]}" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |