-
Notifications
You must be signed in to change notification settings - Fork 0
139 lines (113 loc) · 4.31 KB
/
Copy pathrelease.yml
File metadata and controls
139 lines (113 loc) · 4.31 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: Release Build
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build-windows:
name: Build Windows Release
runs-on: windows-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown, x86_64-pc-windows-msvc
- name: Set up MSVC & Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1
- name: Set up CMake & Ninja
uses: lukka/get-cmake@latest
- name: Build Rust Static Library
working-directory: plug.app/rt
run: cargo build --release --lib --target x86_64-pc-windows-msvc
- name: Build WASM Plugins
shell: bash
run: |
mkdir -p release_pkg
mkdir -p release_pkg/plugins
rustc --target wasm32-unknown-unknown --crate-type cdylib plug.app/rt/src_plugins/pTerm/pTerm.rs -o release_pkg/plugins/pTerm.wasm -C opt-level=z -C lto=true -C link-arg=--allow-undefined
cp plug.app/rt/src_plugins/plugin.toml release_pkg/plugins/plugin.toml
- name: Run CMake Configuration
run: |
cmake -G Ninja -S plug.cross/windows -B plug.cross/windows/build "-DRUST_LIB_PATH=${{ github.workspace }}/plug.app/rt/target/x86_64-pc-windows-msvc/release/tm_main.lib" -DCOMPILE_RUST_CORE=OFF -DCMAKE_BUILD_TYPE=Release
- name: Compile plug executable
run: |
cmake --build plug.cross/windows/build
- name: Prepare Package
run: |
cp plug.cross/windows/build/plug.exe release_pkg/plug.exe
cp LICENSE release_pkg/LICENSE
cp README.md release_pkg/README.md
compress-archive -Path release_pkg/* -DestinationPath plug-windows-x64.zip
- name: Upload Windows Artifact
uses: actions/upload-artifact@v4
with:
name: windows-asset
path: plug-windows-x64.zip
build-linux:
name: Build Linux Release
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Install GTK4 Dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgtk-4-dev pkg-config ninja-build libx11-dev
- name: Build Rust Static Library
working-directory: plug.app/rt
run: cargo build --release --lib --target x86_64-unknown-linux-gnu
- name: Build WASM Plugins
run: |
mkdir -p release_pkg/plugins
rustc --target wasm32-unknown-unknown --crate-type cdylib plug.app/rt/src_plugins/pTerm/pTerm.rs -o release_pkg/plugins/pTerm.wasm -C opt-level=z -C lto=true -C link-arg=--allow-undefined
cp plug.app/rt/src_plugins/plugin.toml release_pkg/plugins/plugin.toml
- name: Run CMake Configuration
run: |
cmake -G Ninja -S plug.cross/linux -B plug.cross/linux/build "-DRUST_LIB_PATH=${{ github.workspace }}/plug.app/rt/target/x86_64-unknown-linux-gnu/release/libtm_main.a" -DCMAKE_BUILD_TYPE=Release
- name: Compile plug executable
run: |
cmake --build plug.cross/linux/build
- name: Prepare Package
run: |
cp plug.cross/linux/build/plug release_pkg/plug
cp LICENSE release_pkg/LICENSE
cp README.md release_pkg/README.md
zip -r plug-linux-x64.zip release_pkg/*
- name: Upload Linux Artifact
uses: actions/upload-artifact@v4
with:
name: linux-asset
path: plug-linux-x64.zip
publish-release:
name: Publish Release to GitHub
runs-on: ubuntu-latest
needs: [build-windows, build-linux]
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Download Windows Asset
uses: actions/download-artifact@v4
with:
name: windows-asset
- name: Download Linux Asset
uses: actions/download-artifact@v4
with:
name: linux-asset
- name: Create Release
uses: softprops/action-gh-release@v2
with:
draft: true
prerelease: false
files: |
plug-windows-x64.zip
plug-linux-x64.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}