-
Notifications
You must be signed in to change notification settings - Fork 3
64 lines (55 loc) · 1.72 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
name: Release Analytics CLI
on:
pull_request:
workflow_dispatch:
inputs:
release_tag:
type: string
description: Tag to create
concurrency: ${{ github.workflow }}
jobs:
build:
name: Build ${{ matrix.target }}
strategy:
matrix:
target: [x86_64-unknown-linux-musl, x86_64-unknown-linux-gnu]
runs-on: [self-hosted, linux]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly
- name: Build ${{ matrix.target }} target
uses: ./.github/actions/build_target
if: "!cancelled()"
with:
target: ${{ matrix.target }}
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.target }}
path: target/${{ matrix.target }}/release/trunk-analytics-cli
tag_and_release:
name: Tag and Release [ ${{ github.event.inputs.release_tag }} ]
runs-on: [self-hosted, Linux]
needs: [build]
steps:
- uses: actions/checkout@v4
- id: download
uses: actions/download-artifact@v3
with:
path: build
- name: Compress binaries
run: |
for target in $(ls build)
do
chmod u+x build/${target}/analytics-cli
tar czvf \
build/trunk-analytics-cli-${{ github.event.inputs.release_tag }}-${target}.tar.gz \
-C build/${target} trunk-analytics-cli
done
- name: Create GH release and upload binary
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create --target ${{ github.ref }} --generate-notes \
${{ github.event.inputs.release_tag }} ./build/*.tar.gz