-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (54 loc) · 1.4 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
name: Release
on:
push:
branches:
- main
paths:
- '**.go'
- 'go.mod'
- 'go.sum'
- '.github/workflows/release.yml'
tags:
- 'v*'
workflow_dispatch:
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
actions: read
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: true
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ^1.16
- name: Install gox
run: go install github.com/mitchellh/gox@latest
- name: Build
run: make cross-compile
- name: Get release version
id: get_version
run: |
version=""
if [ "${GITHUB_REF}" == "refs/heads/main" ]; then
version="nightly"
else
version="$(make version)"
fi
echo "Version: ${version}"
echo "version=${version}" >> $GITHUB_OUTPUT
- name: Publish release
uses: marvinpinto/[email protected]
with:
automatic_release_tag: ${{ steps.get_version.outputs.version }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
prerelease: ${{ github.ref == 'refs/heads/main' }}
title: ${{ steps.get_version.outputs.version }}
files: |
build/dnscheck-*