-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (41 loc) · 1.17 KB
/
build.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
37
38
39
40
41
42
43
44
45
46
47
48
name: Build
on:
push:
paths-ignore:
- "*.md"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
- name: Prepare Version Info
run: |
echo "VERSION=$(git describe --tags --always)" >> $GITHUB_ENV
echo "COMMIT=$(git rev-parse HEAD)" >> $GITHUB_ENV
echo $GITHUB_ENV
- name: Build
run: |
CGO_ENABLED=1
go build -ldflags="-X 'main.Version=${{ env.VERSION }}' -X 'main.Commit=${{ env.COMMIT }}'" -o dist/gopad go.gopad.dev/gopad
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: gopad
path: dist/gopad
- name: Release
if: ${{ github.event_name == 'release' }}
uses: ncipollo/release-action@v1
with:
artifacts: dist/gopad
allowUpdates: true
omitBodyDuringUpdate: true
omitDraftDuringUpdate: true
omitNameDuringUpdate: true
omitPrereleaseDuringUpdate: true