Skip to content

Commit 0f846f3

Browse files
committed
CI test
1 parent 5628b78 commit 0f846f3

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed

.github/workflows/release.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: release
2+
3+
on: [push]
4+
5+
# on:
6+
# push:
7+
# tags:
8+
# - v**
9+
10+
jobs:
11+
build-and-release:
12+
runs-on: ubuntu-22.04
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: dtolnay/rust-toolchain@stable
16+
with:
17+
targets: i686-pc-windows-gnu, x86_64-pc-windows-gnu
18+
19+
- name: Build ewext
20+
run: cargo build --release --target i686-pc-windows-gnu
21+
working-directory: ./ewext
22+
- name: Copy ewext
23+
run: cp ewext/target/i686-pc-windows-gnu/release/ewext.dll quant.ew/ewext0.dll
24+
25+
- name: Build Linux proxy release
26+
run: cargo build --release
27+
working-directory: ./noita_proxy
28+
- name: Build Windows proxy release
29+
run: cargo build --release --target x86_64-pc-windows-gnu
30+
working-directory: ./noita_proxy
31+
32+
- name: Create archives
33+
run: python scripts/ci_make_archives.py
34+
35+
- uses: actions/upload-artifact@v4
36+
with:
37+
name: release
38+
path: target/*
39+

scripts/ci_make_archives.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
cargo_manifest = tomllib.load(open("noita-proxy/Cargo.toml", "rb"))
2+
version = cargo_manifest["package"]["version"]
3+
4+
os.makedirs("target", exist_ok=True)
5+
6+
with ZipFile("target/noita-proxy-win.zip", "w") as release:
7+
release.write("noita-proxy/target/x86_64-pc-windows-gnu/release/noita-proxy.exe", arcname="noita_proxy.exe", compress_type=COMPRESS_TYPE, compresslevel=COMPRESS_LEVEL)
8+
release.write("redist/steam_api64.dll", arcname="steam_api64.dll", compress_type=COMPRESS_TYPE, compresslevel=COMPRESS_LEVEL)
9+
10+
print("Writing linux release...")
11+
12+
with ZipFile("target/noita-proxy-linux.zip", "w") as release:
13+
release.write("noita-proxy/target/release/noita-proxy", arcname="noita_proxy.x86_64", compress_type=COMPRESS_TYPE, compresslevel=COMPRESS_LEVEL)
14+
release.write("redist/libsteam_api.so", arcname="libsteam_api.so", compress_type=COMPRESS_TYPE, compresslevel=COMPRESS_LEVEL)
15+
16+
print("Writing mod release...")
17+
18+
shutil.make_archive("target/quant.ew", "zip", "quant.ew")
19+
20+
with ZipFile("target/quant.ew.zip", "a") as release:
21+
release.writestr("files/version.lua", f'return "{version}"')

0 commit comments

Comments
 (0)