-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
|
||
name: Publish | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
build: | ||
name: Release | ||
permissions: write-all | ||
runs-on: ubuntu-latest | ||
|
||
# Because we need to upload both the linux .so file & the windows .dll file in a single archive, We need to compile both of them in the same runner. | ||
# We can still use a matrix for the different game engines though. | ||
# Also, modifying this to work on macOS is probably impossible, as it has very weird build stuff & cross-compilation is hard on macOS. | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
engine: [ godot, unity ] | ||
include: | ||
- engine: godot | ||
engine_name: Godot | ||
rust_package_dir: TwitchEventSub-Godot | ||
rust_package_name: twitchevents_godot | ||
packing_extra_files: TwitchEventSub-Godot/twitchapi.gdextension | ||
- engine: unity | ||
engine_name: Unity | ||
rust_package_dir: TwitchEventSub-Unity | ||
rust_package_name: rust_unity | ||
packing_extra_files: TwitchEventSub-Unity/src/TwitchEvents.cs TwitchEventSub-Unity/src/TwitchEventsFFI.cs | ||
|
||
steps: | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
# TODO: Cache | ||
|
||
|
||
|
||
- name: Build for Linux | ||
run: | | ||
rustup toolchain install stable --profile minimal --target x86_64-unknown-linux-gnu --no-self-update | ||
cd ${{ matrix.rust_package_dir }} | ||
cargo build --release --target x86_64-unknown-linux-gnu | ||
- name: Build for Windows | ||
run: | | ||
rustup toolchain install stable --profile minimal --target x86_64-pc-windows-gnu --no-self-update | ||
sudo apt-get install -y gcc-mingw-w64-x86-64 | ||
cd ${{ matrix.rust_package_dir }} | ||
cargo build --release --target x86_64-pc-windows-gnu | ||
- name: Package to archive | ||
run: | | ||
mkdir -p packing | ||
cp ${{ matrix.rust_package_dir }}/target/x86_64-unknown-linux-gnu/release/lib${{ matrix.rust_package_name }}.so packing/ | ||
cp ${{ matrix.rust_package_dir }}/target/x86_64-pc-windows-gnu/release/${{ matrix.rust_package_name }}.dll packing/ | ||
cp ${{ matrix.packing_extra_files }} packing/ | ||
tar -c -f Release-${{ github.ref }}-${{ matrix.engine_name }}.zip -C packing . | ||
- name: Upload to release | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: Release-${{ github.ref }}-${{ matrix.engine_name }}.zip | ||
tag: ${{ github.ref }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[configuration] | ||
entry_symbol = "gdext_rust_init" | ||
compatibility_minimum = 4.1 | ||
reloadable = true | ||
|
||
[libraries] | ||
linux.debug.x86_64 = "res://libtwitchevents_godot.so" | ||
linux.release.x86_64 = "res://libtwitchevents_godot.so" | ||
windows.debug.x86_64 = "res://twitchevents_godot.dll" | ||
windows.release.x86_64 = "res://twitchevents_godot.dll" | ||
macos.debug = "res://librust_project.dylib" | ||
macos.release = "res://librust_project.dylib" | ||
macos.debug.arm64 = "res://librust_project.dylib" | ||
macos.release.arm64 = "res://librust_project.dylib" |