This repository was archived by the owner on Jan 30, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
59 lines (51 loc) · 1.57 KB
/
release.yaml
File metadata and controls
59 lines (51 loc) · 1.57 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
name: Release Binaries
on:
release:
types:
- published
workflow_dispatch:
push:
branches: [ ghactions ]
env:
DEFAULT_BIN_NAME: productctl
jobs:
binaries:
strategy:
matrix:
os:
- ubuntu-latest # amd64
- ubuntu-22.04-arm # arm64
- macos-latest # arm64
- macos-15-intel # amd64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python and uv
uses: ./.github/actions/setup-python-uv
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Set RELEASE_TAG from GITHUB_REF
if: ${{ github.event_name == 'release' }}
run: |
echo "Event is: ${{ github.event_name }}"
echo RELEASE_TAG=$(echo $GITHUB_REF | cut -d '/' -f 3) | tee $GITHUB_ENV
- name: Build Binary
# We do not regenerate assets on releases. We use what is in repo.
# For this reason, we use `make bin` and not `make build`.
env:
BIN_NAME: ${{ env.DEFAULT_BIN_NAME }}
BIN_VERSION: ${{ env.RELEASE_TAG || 'unknown' }}
run: |
BIN_FILE="${BIN_NAME}" \
BIN_VERSION="${BIN_VERSION}" \
make bin
mv -v "${BIN_NAME}" "${BIN_NAME}-$(go env GOOS)-$(go env GOARCH)"
echo FINAL_BIN_NAME="${BIN_NAME}-$(go env GOOS)-$(go env GOARCH)" | tee $GITHUB_ENV
- name: Add to release
if: ${{ github.event_name == 'release' }}
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release upload "${{ env.RELEASE_TAG }}" "${{ env.FINAL_BIN_NAME }}"