Skip to content

Commit

Permalink
adds gh workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
audibleblink committed May 20, 2021
1 parent 015f54d commit f491537
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
on:
push:
tags:
- 'v*'

name: Build and Release

jobs:

release:
name: 'Create Release from Tag'
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:

- name: Checkout
uses: actions/checkout@master

- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get_version.outputs.VERSION }}
release_name: Release ${{ steps.get_version.outputs.VERSION }}
draft: false
prerelease: false

build:
name: 'Build and Upload Release Binary'
runs-on: ubuntu-latest
needs: release
strategy:
matrix:
OSes: ['windows', 'darwin', 'linux']
arch: ['amd64']

steps:
- name: 'Checkout'
uses: actions/checkout@master

- name: 'Setup Golang Environment'
uses: actions/setup-go@v2
with:
go-version: '^1.16'

- name: 'Build ${{ matrix.OSes }}-${{ matrix.arch }}'
run: |
GOOS=${{ matrix.OSes }} \
GOARCH=${{ matrix.arch }} \
go build -o ino_${{ matrix.OSes }}_${{ matrix.arch }}
- name: 'Upload Release Assets'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./ino_${{ matrix.OSes }}_${{ matrix.arch }}
asset_name: ino_${{ matrix.OSes }}_${{ matrix.arch }}
asset_content_type: application/octet-stream

0 comments on commit f491537

Please sign in to comment.