-
-
Notifications
You must be signed in to change notification settings - Fork 14
75 lines (67 loc) · 2.04 KB
/
build-dg.yaml
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
name: Build DG
on:
workflow_call:
push:
branches:
- cli
jobs:
build-dg:
runs-on:
- self-hosted
- Linux
- X64
defaults:
run:
working-directory: ./src-tauri/cli
strategy:
fail-fast: false
matrix:
build: [linux, linux-arm64, freebsd]
include:
- build: linux
arch: amd64
target: x86_64-unknown-linux-gnu
# - build: linux-arm64
# arch: arm64
# target: aarch64-unknown-linux-gnu
# - build: freebsd
# arch: amd64
# target: x86_64-unknown-freebsd
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y libprotobuf-dev libssl-dev protobuf-compiler rpm
- name: Install Rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- name: Build release binary
uses: actions-rs/cargo@v1
with:
command: build
args: --locked --release --target ${{ matrix.target }}
use-cross: true
- name: Rename binary
run: mv ../target/${{ matrix.target }}/release/dg dg-${{ github.ref_name }}-${{ matrix.target }}
- name: Tar
uses: a7ul/[email protected]
with:
command: c
files: |
dg-${{ github.ref_name }}-${{ matrix.target }}
outPath: dg-${{ github.ref_name }}-${{ matrix.target }}.tar.gz
- name: Upload release archive
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: dg-${{ github.ref_name }}-${{ matrix.target }}.tar.gz
asset_name: dg-${{ github.ref_name }}-${{ matrix.target }}.tar.gz
asset_content_type: application/octet-stream