-
Notifications
You must be signed in to change notification settings - Fork 17
81 lines (76 loc) · 2.59 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: Release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v20.15.10
- "v[0-9]+.[0-9]+.[0-9]+.?[0-9]*" # Push events to matching v*, v20.15.10.1
- "v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+" # Push events to matching alpha releases
- "v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+" # Push events to matching beta releases
- "v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+" # Push events to matching release candidates
jobs:
native-build-cli:
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-20.04, macos-latest]
steps:
- uses: actions/checkout@v4.1.7
- uses: actions/setup-go@v5
with:
go-version: 1.22.2 # The Go version to download (if necessary) and use.
- name: Build CLI
shell: bash
run: |
make build
cp "build/canined" "canined-$RUNNER_OS"
- uses: actions/upload-artifact@v4
with:
name: canined-${{runner.os}}
path: canined-${{runner.os}}
# MacOS-ARM64-CLI:
# runs-on: ubuntu-20.04
# steps:
# - uses: actions/checkout@v4.1.7
# - uses: actions/setup-go@v5
# with:
# go-version: 1.19 # The Go version to download (if necessary) and use.
# - name: Install xgo
# run: |
# go install github.com/crazy-max/xgo@v0.17.0
# xgo || true # check installation
# - name: Build MacOS CLI
# shell: bash
# run: |
# make build_macos_arm64_cli
# cp "canined-macos-arm64" "canined-MacOS-arm64"
# - uses: actions/upload-artifact@v4
# with:
# name: canined-MacOS-arm64
# path: canined-MacOS-arm64
Release:
needs:
[native-build-cli]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4.1.7
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}
- name: Declare Commit Variables
id: is_pre_release
shell: bash
run: |
echo "::set-output name=IS_PRE_RELEASE::$(echo "${{ steps.get_version.outputs.VERSION }}" | awk 'BEGIN{prerelease="false"} /beta|alpha/{prerelease="true"} END{print prerelease}')"
- uses: actions/download-artifact@v4
with:
name: canined-Linux
- uses: actions/download-artifact@v4
with:
name: canined-macOS
- name: Release
uses: softprops/action-gh-release@v2
with:
prerelease: ${{ steps.is_pre_release.outputs.IS_PRE_RELEASE }}
files: |
canined-macOS
canined-Linux