-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (80 loc) · 2.38 KB
/
cli.yml
File metadata and controls
92 lines (80 loc) · 2.38 KB
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
84
85
86
87
88
89
90
91
92
name: Build CLI Clients
on:
release:
types:
- published
workflow_dispatch:
permissions:
contents: write
jobs:
build:
name: Build CLI Clients
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macos-latest
goos: darwin
goarch: arm64
- os: ubuntu-24.04-arm
goos: linux
goarch: arm64
- os: ubuntu-24.04
goos: linux
goarch: amd64
- os: ubuntu-24.04
goos: windows
goarch: amd64
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
ref: ${{ github.event_name == 'release' && github.event.release.tag_name ||
github.ref_name }}
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Compute build metadata
shell: bash
run: |
echo "VERSION=$(git describe --tags --always | sed 's/^v//')" >> "$GITHUB_ENV"
echo "GIT_BRANCH=$(git name-rev HEAD --name-only --always)" >> "$GITHUB_ENV"
- name: Build Client
env:
OS: ${{ matrix.goos }}
ARCH: ${{ matrix.goarch }}
shell: bash
run: make client
- name: Rename binary for release
shell: bash
run: |
if [ "${{ matrix.goos }}" = "windows" ]; then
mv build/authmanager build/authmanager-${{ matrix.goos }}-${{ matrix.goarch }}.exe
else
mv build/authmanager build/authmanager-${{ matrix.goos }}-${{ matrix.goarch }}
fi
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: authmanager-${{ matrix.goos }}-${{ matrix.goarch }}
path: build/authmanager-${{ matrix.goos }}-${{ matrix.goarch }}*
release:
name: Attach CLI Assets
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'release'
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts
- name: Attach assets to published release
uses: softprops/action-gh-release@v3
with:
tag_name: ${{ github.event.release.tag_name }}
files: ./artifacts/**/*
overwrite_files: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}