-
Notifications
You must be signed in to change notification settings - Fork 4
107 lines (97 loc) · 3.31 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
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
97
98
99
100
101
102
103
104
105
106
107
# This Github workflow will create a new release when a tag is pushed,
# then it will build the binary and it will add it to the release assets
# in a tar.gz archive along with other components.
#
# Reference:
# https://github.com/BurntSushi/ripgrep/blob/master/.github/workflows/release.yml
# https://github.com/rhino-linux/rhino-setup/blob/master/.github/workflows/package.yml
name: release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
jobs:
create-release:
name: create-release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.release.outputs.upload_url }}
version: ${{ github.ref_name }}
steps:
- name: Create Github Release
id: release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: ${{ github.ref_name }}
build-release:
name: build-release
needs: ["create-release"]
runs-on: ${{ matrix.os }}
env:
TARGET_DIR: ./target
# Emit backtraces on panics.
RUST_BACKTRACE: 1
strategy:
matrix:
build: [x86_64-linux-musl]
# FIX: Building for arm and i686.
include:
# - build: x86_64-linux-gnu
# os: ubuntu-latest
# rust: stable
# target: x86_64-unknown-linux-gnu
- build: x86_64-linux-musl
os: ubuntu-latest
rust: stable
target: x86_64-unknown-linux-musl
# - build: i686-linux-gnu
# os: ubuntu-latest
# rust: stable
# target: i686-unknown-linux-musl
# - build: i686-linux-musl
# os: ubuntu-latest
# rust: stable
# target: i686-unknown-linux-musl
# - build: arm-linux-gnueabihf
# os: ubuntu-latest
# rust: stable
# target: arm-unknown-linux-gnueabihf
# - build: arm-linux-musleabihf
# os: ubuntu-latest
# rust: stable
# target: arm-unknown-linux-musleabihf
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install Rust Toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ matrix.rust }}
targets: ${{ matrix.target }}
- name: Install System Deps
shell: bash
# FIX: Install deps for arm and i686
run: sudo apt install libdbus-1-dev desktop-file-utils gettext meson -y
# FIX: Building for arm and i686 with meson
- name: Setup
run: meson build
- name: Build
run: meson install -C build --destdir "builds/${{ matrix.target }}"
- name: Create Archive
shell: bash
run: |
archive="ianny-${{ needs.create-release.outputs.version }}-${{ matrix.target }}.tar.gz"
tar -C "build/builds/" --create "${{ matrix.target }}/" --gzip --file "$archive"
echo "ASSET=$archive" >> $GITHUB_ENV
- 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: ${{ env.ASSET }}
asset_name: ${{ env.ASSET }}
asset_content_type: application/octet-stream