-
-
Notifications
You must be signed in to change notification settings - Fork 9
81 lines (70 loc) · 2.35 KB
/
release.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
name: Intercept Binary Release
on:
push:
tags:
- "*"
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all tags and branches
- uses: actions/setup-go@v4
with:
go-version-file: go.mod
- name: Get latest tag
id: get_latest_tag
run: |
# Try to get tag for the current commit
CURRENT_TAG=$(git describe --exact-match --tags HEAD 2>/dev/null || echo "")
# If no tag for current commit, get the most recent tag
if [ -z "$CURRENT_TAG" ]; then
CURRENT_TAG=$(git describe --tags --abbrev=0)
fi
echo "LATEST_TAG=${CURRENT_TAG}" >> $GITHUB_OUTPUT
- name: Fetch Tags
run: |
git fetch --tags -f
git describe --abbrev=0
- name: Get dependencies
run: |
go get -v -t -d ./...
if [ -f Gopkg.toml ]; then
curl https://x.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
fi
- name: Make all release artifacts
run: make build-all
- name: Upload All artifacts
uses: meeDamian/[email protected]
with:
tag: ${{ steps.get_latest_tag.outputs.LATEST_TAG }}
allow_override: "true"
draft: "true"
token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ steps.get_latest_tag.outputs.LATEST_TAG }}
body: >
Release ${{ steps.get_latest_tag.outputs.LATEST_TAG }}
gzip: "true"
files: >
release/intercept-darwin-amd64
release/intercept-darwin-amd64.sha256
release/intercept-darwin-arm64
release/intercept-darwin-arm64.sha256
release/intercept-linux-amd64
release/intercept-linux-amd64.sha256
release/intercept-linux-arm-v7
release/intercept-linux-arm-v7.sha256
release/intercept-linux-arm64
release/intercept-linux-arm64.sha256
release/intercept-windows-amd64.exe
release/intercept-windows-amd64.exe.sha256