-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (34 loc) · 1.33 KB
/
go-release.yaml
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
#
# Do not edit. This file was generated via the "workflow" command line tool.
# More information about the tool can be found at github.com/xh3b4sd/workflow.
#
# workflow create releasego -n workflow -s gitSHA -t version
#
name: "go-release"
on:
push:
tags:
- "v*.*.*"
jobs:
release:
permissions:
contents: write
runs-on: "ubuntu-latest"
steps:
- name: "Setup Git Project"
uses: "actions/checkout@v4"
- name: "Setup Go Env"
uses: "actions/setup-go@v5"
with:
cache: true
go-version: "1.22.5"
- name: "Cross Compile Binaries"
run: |
GOOS=darwin GOARCH=amd64 go build -o workflow-darwin-amd64 -ldflags="-X 'github.com/${{ github.repository_owner }}/workflow/pkg/project.gitSHA=${{ github.sha }}' -X 'github.com/${{ github.repository_owner }}/workflow/pkg/project.version=${{ github.ref_name }}'"
GOOS=linux GOARCH=amd64 go build -o workflow-linux-amd64 -ldflags="-X 'github.com/${{ github.repository_owner }}/workflow/pkg/project.gitSHA=${{ github.sha }}' -X 'github.com/${{ github.repository_owner }}/workflow/pkg/project.version=${{ github.ref_name }}'"
- name: "Upload To Github"
uses: "softprops/action-gh-release@v2"
with:
files: |
workflow-darwin-amd64
workflow-linux-amd64