-
Notifications
You must be signed in to change notification settings - Fork 4
124 lines (124 loc) · 4.49 KB
/
Copy pathgithub-actions-demo.yml
File metadata and controls
124 lines (124 loc) · 4.49 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: Rubic Builder
run-name: Building Rubic With GitHub Action 🚀
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
env:
CARGO_TERM_COLOR: always
jobs:
linux:
permissions:
contents: write
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install System Packages
run: sudo apt update && sudo apt install -y build-essential pkg-config libgtk-3-dev libwebkit2gtk-4.1-dev libsoup-3.0-dev
- name: Install Cargo Toolchain
run: rustup install nightly
- name: Install Tauri
run: cargo install tauri-cli --version "^2.0.0" --locked
- name: Build Frontend
run: cd frontend && yarn install --network-timeout 1000000000 && yarn build && cd ..
- name: Build Rubic
run: cargo tauri build --no-bundle
- name: Bundle Rubic
run: cargo tauri bundle --bundles deb
- name: View App Artifacts Dir
run: ls src-tauri/target/release/
- name: View App Artifacts Bundle Dir
run: ls src-tauri/target/release/bundle/
- name: Generate release tag
id: tag
run: |
echo "::set-output name=release_tag::Release_$(date +"%Y.%m.%d_%H-%M")"
- uses: actions/upload-artifact@v4
with:
name: Rubic-linux
path: src-tauri/target/release/bundle/deb/Rubic_1.0.0_amd64.deb
- run: echo "🍏 This job's status is ${{ job.status }}."
mac:
permissions:
contents: write
runs-on: macos-14
steps:
- uses: actions/checkout@v3
- name: Install Cargo Toolchain
run: rustup install nightly
- name: Install Tauri
run: cargo install tauri-cli --version "^2.0.0" --locked
- name: Build Frontend
run: cd frontend && yarn install --network-timeout 1000000000 && yarn build && cd ..
- name: Build Rubic
run: cargo tauri build --no-bundle
- name: Bundle Rubic
run: cargo tauri bundle --bundles app
- name: Remove Quarantine Attribute
run: sudo xattr -rd com.apple.quarantine src-tauri/target/release/bundle/macos/Rubic.app
- name: Zip App Bundle
run: cd src-tauri/target/release/bundle/macos/ && zip -9 -y -r -q Rubic-macos.zip Rubic.app && cd ../../../../..
- name: Generate release tag
id: tag
run: |
echo "::set-output name=release_tag::Release_$(date +"%Y.%m.%d_%H-%M")"
- uses: actions/upload-artifact@v4
with:
name: Rubic-macos
path: src-tauri/target/release/bundle/macos/Rubic-macos.zip
- run: echo "🍏 This job's status is ${{ job.status }}."
windows:
permissions:
contents: write
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Install Cargo Toolchain
run: rustup install nightly
- name: Install Tauri
run: cargo install tauri-cli --version "^2.0.0" --locked
- name: Build Frontend
run: cd frontend; yarn install --network-timeout 1000000000; yarn build; cd ..;
- name: Build Rubic
run: cargo tauri build
- name: Generate Commit Hash
run: echo ${{ github.sha }} > Release.txt
- name: Generate Env Vars Version
run: echo RUBIC_VERSION=${{ github.sha }} > .env
- name: Generate Env Vars Port
run: echo RUBIC_PORT=3000 >> .env
- name: Generate Env Vars Max Peers
run: echo RUBIC_MAX_PEERS=7 >> .env
- name: Generate Env Vars Min Peers
run: echo RUBIC_MIN_PEERS=3 >> .env
- name: Generate Env Vars Log Level
run: echo RUBIC_LOG_LEVEL=error >> .env
- name: Show current dir files
run: dir src-tauri/target/release
- name: Generate release tag
id: tag
run: |
echo "::set-output name=release_tag::Release_$(date +"%Y.%m.%d_%H-%M")"
- uses: actions/download-artifact@v4
with:
name: Rubic-macos
path: ./mac/
- uses: actions/download-artifact@v4
with:
name: Rubic-linux
path: ./linux/
- name: Publish Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.tag.outputs.release_tag }}
files: |
src-tauri/target/release/Rubic.exe
linux/Rubic_1.0.0_amd64.deb
mac/Rubic-macos.zip
LICENSE
Release.txt
- run: echo "🍏 This job's status is ${{ job.status }}."