-
Notifications
You must be signed in to change notification settings - Fork 1
105 lines (104 loc) · 3.46 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
name: release
on:
push:
tags:
- "v*"
jobs:
release:
name: Create release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.release.outputs.upload_url }}
release_id: ${{ steps.release.outputs.id }}
steps:
- name: Create Release
id: release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
build:
name: Build and Upload Release Asset
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
artifact_name: halberdcli
asset_name: halberd-x86_64-unknown-linux-gnu
quick_start: quick_halberd.sh
- os: ubuntu-latest
target: x86_64-pc-windows-gnu
artifact_name: halberdcli.exe
asset_name: halberd-x86_64-pc-windows-gnu
quick_start: quick_halberd.bat
runs-on: ${{ matrix.os }}
needs: release
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
- name: install dependencies (ubuntu only)
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
- run: cargo install cross --git https://github.com/cross-rs/cross
- run: cross build --release --target ${{ matrix.target }} --all-features --workspace --exclude halberd_gui
- name: Copy binary
run: |
cp target/${{ matrix.target }}/release/${{ matrix.artifact_name }} ./
- name: Copy quick start scripts
run: |
cp scripts/${{ matrix.quick_start }} ./
- name: Create zip
run: |
zip ${{ matrix.asset_name }}.zip ${{ matrix.artifact_name }} README.md ${{ matrix.quick_start }}
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./${{ matrix.asset_name }}.zip
asset_name: ${{ matrix.asset_name }}.zip
asset_content_type: application/zip
build-tauri:
strategy:
fail-fast: false
matrix:
platform: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.platform }}
needs: release
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- name: setup node
uses: actions/setup-node@v1
with:
node-version: 16
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
- name: install app dependencies and build it
run: cd halberd_gui && yarn && yarn build
- name: view needs.release.outputs.release_id
run: echo ${{ needs.release.outputs.release_id }}
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
releaseId: ${{ needs.release.outputs.release_id }}
projectPath: ./halberd_gui