-
Notifications
You must be signed in to change notification settings - Fork 36
93 lines (82 loc) · 2.71 KB
/
tembo_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
82
83
84
85
86
87
88
89
90
91
92
name: Github release for the repo
permissions:
contents: write
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
cargo_build:
name: Cargo build
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-apple-darwin
asset_name: x86_64-apple
os: macos-latest
- target: aarch64-apple-darwin
asset_name: arm-apple
os: macos-latest
- target: x86_64-unknown-linux-musl
asset_name: x86_64-linux
os: ubuntu-20.04
container: quay.io/tembo/muslrust:1.71.0-stable
- target: aarch64-unknown-linux-musl
asset_name: arm-linux
os: ubuntu-20.04
container: messense/rust-musl-cross:aarch64-musl
runs-on: ${{ matrix.os }}
container:
image: ${{ matrix.container }}
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Install Deps Ubuntu
id: install_deps_ubuntu
run: |
set -x
apt update -y
apt install pkg-config libssl-dev -y
if: matrix.os == 'ubuntu-20.04'
- name: Cargo build
working-directory: ./tembo-cli
id: cargo_build
run: |
set -x
rustup target add ${{ matrix.target }}
cargo build --release --target=${{ matrix.target }}
git config --global --add safe.directory '*'
- name: CLI version Mac
working-directory: ./tembo-cli
id: cli_version_mac
run: |
set -x
cargo install cargo-get
TEMBO_CLI_NAME=$(cargo-get package.name)-$(cargo-get package.version)
echo "TEMBO_CLI_NAME=$TEMBO_CLI_NAME" >> $GITHUB_ENV
if: matrix.os == 'macos-latest'
- name: CLI version Ubuntu
working-directory: ./tembo-cli
id: cli_version_ubuntu
run: |
set -x
TEMBO_VERSION=$(target/${{ matrix.target }}/release/tembo --version)
TEMBO_CLI_NAME="$(echo $TEMBO_VERSION | sed 's/ /-/g')"
echo "TEMBO_CLI_NAME=$TEMBO_CLI_NAME" >> $GITHUB_ENV
if: matrix.os == 'ubuntu-20.04'
- name: Generate changelog
id: changelog
uses: metcalfc/[email protected]
with:
myToken: ${{ secrets.GITHUB_TOKEN }}
fetch: false
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: tembo-cli/target/${{ matrix.target }}/release/tembo
asset_name: ${{ env.TEMBO_CLI_NAME }}-${{ matrix.asset_name }}
prerelease: true
tag: ${{ github.ref }}
body: ${{ steps.changelog.outputs.changelog }}