Release #3
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: Release | |
on: [workflow_dispatch] | |
jobs: | |
tag: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Push Tag | |
id: tag_version | |
uses: mathieudutour/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create a GitHub release | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: ${{ steps.tag_version.outputs.new_tag }} | |
name: Release ${{ steps.tag_version.outputs.new_tag }} | |
body: ${{ steps.tag_version.outputs.changelog }} | |
draft: false | |
release: | |
runs-on: ubuntu-latest | |
needs: tag | |
strategy: | |
matrix: | |
goos: [darwin, linux, windows] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.16 | |
- name: Set up Node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "12" | |
- name: Get release | |
id: release | |
uses: bruceadams/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install NPM packages | |
run: cd ui && rm package-lock.json && npm install && npm run build | |
- name: Build Release Binary | |
run: | | |
GOOS=${{ matrix.goos }} GOARCH=amd64 make GCFLAGS="-tags=prod" | |
tar -czvf fitwave_${{ steps.release.outputs.tag_name }}_${{ matrix.goos }}_amd64.tar.gz fitwave | |
ls | |
- name: Upload Release Binary | |
id: upload-go-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.release.outputs.upload_url }} | |
asset_path: ./fitwave_${{ steps.release.outputs.tag_name }}_${{ matrix.goos }}_amd64.tar.gz | |
asset_name: fitwave_${{ steps.release.outputs.tag_name }}_${{ matrix.goos }}_amd64.tar.gz | |
asset_content_type: application/gzip |