forked from nadoo/glider
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (72 loc) · 2.18 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Build
on:
push:
branches:
- 'dev'
tags:
- '*'
pull_request:
env:
APP_NAME: glider
DOCKERHUB_REPO: nadoo/glider
GHCR_REPO: ghcr.io/nadoo/glider
PLATFORMS: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/riscv64
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set Vars
run: |
echo "SHA_SHORT=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Set up Go
uses: actions/setup-go@v5
with:
check-latest: true
go-version-file: 'go.mod'
cache: true
- name: Test
run: go test -v .
- name: Build
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: build --snapshot --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Artifact - Linux amd64
uses: actions/upload-artifact@v4
with:
name: ${{ env.APP_NAME }}-dev-${{ env.SHA_SHORT }}-linux-amd64
path: |
./dist/default_linux_amd64_v1/${{ env.APP_NAME }}
- name: Upload Artifact - Linux arm64
uses: actions/upload-artifact@v4
with:
name: ${{ env.APP_NAME }}-dev-${{ env.SHA_SHORT }}-linux-arm64
path: |
./dist/default_linux_arm64/${{ env.APP_NAME }}
- name: Upload Artifact - Darwin arm64
uses: actions/upload-artifact@v4
with:
name: ${{ env.APP_NAME }}-dev-${{ env.SHA_SHORT }}-darwin-arm64
path: |
./dist/default_darwin_arm64/${{ env.APP_NAME }}
- name: Upload Artifact - Windows amd64
uses: actions/upload-artifact@v4
with:
name: ${{ env.APP_NAME }}-dev-${{ env.SHA_SHORT }}-windows-amd64
path: |
./dist/default_windows_amd64_v1/${{ env.APP_NAME }}.exe
- name: Release
uses: goreleaser/goreleaser-action@v5
if: startsWith(github.ref, 'refs/tags/')
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}