-
Notifications
You must be signed in to change notification settings - Fork 5
96 lines (81 loc) · 3.17 KB
/
release.yml
File metadata and controls
96 lines (81 loc) · 3.17 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
93
94
95
96
name: Release
on:
workflow_dispatch:
inputs:
tag:
description: tag name
push:
tags:
- v*.*.*
jobs:
release:
name: "Job - ${{ matrix.name }}"
runs-on: "${{ matrix.os }}"
env:
EDITION: community
strategy:
fail-fast: true
matrix:
include:
# Linux GUI binaries are built in docker container with lower glibc dependency
# but the CLI binaries are built directly with musl target
# Note: We have to build both GUI and CLI binaries in the same environment so
# that we can include both of them in the offline package. But we cannot relying
# on docker to build the musl targeted CLI binaries because most of the non-musl
# targeted docker container out there lack the configuration to build musl binaries.
- name: dist-aarch64-linux
os: ubuntu-22.04-arm
build-target: aarch64-unknown-linux-musl
dist-targets: aarch64-unknown-linux-gnu
- name: dist-x86-64-linux
os: ubuntu-22.04
build-target: x86_64-unknown-linux-musl
dist-targets: x86_64-unknown-linux-gnu
- name: dist-windows-msvc
os: windows-latest
build-target: x86_64-pc-windows-msvc
dist-targets: x86_64-pc-windows-msvc,x86_64-pc-windows-gnu
steps:
- name: checkout the source code
uses: actions/checkout@v4
- name: install dependencies (Linux)
if: contains(matrix.build-target, 'linux')
run: |
bash ci/scripts/install-tauri-deps.sh
sudo apt-get install -y musl-tools
- name: setup NodeJS
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: install pnpm
run: npm i -g pnpm
- name: install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.build-target }}
- name: download packages for offline build
run: cargo dev vendor --for ${{ matrix.dist-targets }}
- name: run build job (linux gnu)
if: contains(matrix.build-target, 'linux')
run: |
# build CLI binary with musl first. Then use docker to build the GUI binary,
# which will automatically collects the previous CLI binary when packing offline package,
cargo dev dist --cli -b --target ${{ matrix.build-target }} --for ${{ matrix.dist-targets }}
bash ci/scripts/build-in-docker.sh ${{ matrix.name }}
- name: run build job (windows)
if: contains(matrix.build-target, 'windows')
run: cargo dev dist --target ${{ matrix.build-target }} --for ${{ matrix.dist-targets }}
- name: upload release to OBS
env:
ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY_ID }}
SECURITY_KEY_ID: ${{ secrets.SECURITY_KEY_ID }}
run: |
bash ci/scripts/upload-release.sh dist/ obs://rust-mirror/installer/latest
- name: github release
uses: ncipollo/release-action@v1
with:
tag: ${{ github.event.inputs.tag }}
allowUpdates: true
generateReleaseNotes: true
artifacts: "./dist/**/*"
prerelease: true