-
Notifications
You must be signed in to change notification settings - Fork 25
37 lines (30 loc) · 903 Bytes
/
go.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Build and Release
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
run: |
VERSION=$(grep '^VERSION=' Makefile | awk -F= '{print $2}')
echo "::set-output name=CURRENT_VERSION::$VERSION"
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Build
run: make
- name: Create Release
# Only create a release on push to the main branch
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: softprops/[email protected]
with:
name: Release v${{ steps.get-version.outputs.CURRENT_VERSION }}
tag_name: v${{ steps.get-version.outputs.CURRENT_VERSION }}
draft: true
prerelease: true