mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 07:03:16 +00:00
CI test again
This commit is contained in:
parent
3de4aee5d5
commit
5194b35310
3 changed files with 102 additions and 30 deletions
76
.github/workflows/release.yml
vendored
76
.github/workflows/release.yml
vendored
|
@ -8,19 +8,20 @@ on: [push]
|
|||
# - v**
|
||||
|
||||
jobs:
|
||||
build-and-release:
|
||||
build-mod:
|
||||
runs-on: ubuntu-22.04
|
||||
name: Build mod and ewext
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
targets: i686-pc-windows-gnu, x86_64-pc-windows-gnu
|
||||
targets: i686-pc-windows-gnu
|
||||
- name: Install extra deps
|
||||
run: sudo apt-get install -y libclang-dev libgtk-3-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libssl-dev gcc-mingw-w64-i686 gcc-mingw-w64
|
||||
run: sudo apt-get install -y gcc-mingw-w64-i686
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: noita-proxy -> target
|
||||
workspaces: ewext -> target
|
||||
|
||||
- name: Build ewext
|
||||
run: cargo build --release --target i686-pc-windows-gnu
|
||||
|
@ -28,18 +29,79 @@ jobs:
|
|||
- name: Copy ewext
|
||||
run: cp ewext/target/i686-pc-windows-gnu/release/ewext.dll quant.ew/ewext0.dll
|
||||
|
||||
- name: Create archive
|
||||
run: python scripts/ci_make_archives.py mod
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: quant.ew.zip
|
||||
path: target/quant.ew.zip
|
||||
|
||||
build-proxy-linux:
|
||||
name: Build proxy for linux
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
targets: x86_64-pc-windows-gnu
|
||||
- name: Install extra deps
|
||||
run: sudo apt-get install -y libclang-dev libgtk-3-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libssl-dev gcc-mingw-w64-i686 gcc-mingw-w64
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: noita-proxy -> target
|
||||
|
||||
- name: Build Linux proxy release
|
||||
run: cargo build --release
|
||||
working-directory: ./noita-proxy
|
||||
|
||||
- name: Create archives
|
||||
run: python scripts/ci_make_archives.py linux
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: noita-proxy-linux.zip
|
||||
path: target/noita-proxy-linux.zip
|
||||
|
||||
build-proxy-windows:
|
||||
name: Build proxy for windows
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
targets: x86_64-pc-windows-gnu
|
||||
- name: Install extra deps
|
||||
run: sudo apt-get install -y libclang-dev libgtk-3-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libssl-dev gcc-mingw-w64-i686 gcc-mingw-w64
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: noita-proxy -> target
|
||||
|
||||
- name: Build Windows proxy release
|
||||
run: cargo build --release --target x86_64-pc-windows-gnu
|
||||
working-directory: ./noita-proxy
|
||||
|
||||
- name: Create archives
|
||||
run: python scripts/ci_make_archives.py
|
||||
run: python scripts/ci_make_archives.py windows
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: release
|
||||
path: target/*
|
||||
name: noita-proxy-windows.zip
|
||||
path: target/noita-proxy-windows.zip
|
||||
|
||||
release:
|
||||
name: Release
|
||||
runs-on: ubuntu-22.04
|
||||
needs: [build-mod, build-proxy-linux, build-proxy-windows]
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
|
||||
steps:
|
||||
- name: Download all workflow run artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
- run: ls
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,32 +1,35 @@
|
|||
import os
|
||||
import sys
|
||||
from zipfile import ZipFile, ZIP_DEFLATED as COMPRESS_TYPE
|
||||
import shutil
|
||||
import re
|
||||
|
||||
from ci_version import version
|
||||
|
||||
COMPRESS_LEVEL = 9
|
||||
|
||||
cargo_manifest = open("noita-proxy/Cargo.toml", "r").read()
|
||||
version = re.findall('version = "(.*?)"', cargo_manifest)[0]
|
||||
|
||||
print("Version:", version)
|
||||
|
||||
assert version is not None
|
||||
|
||||
os.makedirs("target", exist_ok=True)
|
||||
|
||||
with ZipFile("target/noita-proxy-win.zip", "w") as release:
|
||||
mode = sys.argv[1]
|
||||
|
||||
if mode == "windows":
|
||||
print("Writing windows release...")
|
||||
|
||||
with ZipFile("target/noita-proxy-win.zip", "w") as release:
|
||||
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)
|
||||
release.write("redist/steam_api64.dll", arcname="steam_api64.dll", compress_type=COMPRESS_TYPE, compresslevel=COMPRESS_LEVEL)
|
||||
elif mode == "linux":
|
||||
print("Writing linux release...")
|
||||
|
||||
print("Writing linux release...")
|
||||
|
||||
with ZipFile("target/noita-proxy-linux.zip", "w") as release:
|
||||
with ZipFile("target/noita-proxy-linux.zip", "w") as release:
|
||||
release.write("noita-proxy/target/release/noita-proxy", arcname="noita_proxy.x86_64", compress_type=COMPRESS_TYPE, compresslevel=COMPRESS_LEVEL)
|
||||
release.write("redist/libsteam_api.so", arcname="libsteam_api.so", compress_type=COMPRESS_TYPE, compresslevel=COMPRESS_LEVEL)
|
||||
elif mode == "mod":
|
||||
print("Writing mod release...")
|
||||
|
||||
print("Writing mod release...")
|
||||
shutil.make_archive("target/quant.ew", "zip", "quant.ew")
|
||||
|
||||
shutil.make_archive("target/quant.ew", "zip", "quant.ew")
|
||||
|
||||
with ZipFile("target/quant.ew.zip", "a") as release:
|
||||
with ZipFile("target/quant.ew.zip", "a") as release:
|
||||
release.writestr("files/version.lua", f'return "{version}"')
|
||||
else:
|
||||
exit(-1)
|
||||
|
||||
|
|
7
scripts/ci_version.py
Normal file
7
scripts/ci_version.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
import re
|
||||
|
||||
cargo_manifest = open("noita-proxy/Cargo.toml", "r").read()
|
||||
version = re.findall('version = "(.*?)"', cargo_manifest)[0]
|
||||
|
||||
print("Version:", version)
|
||||
assert version is not None
|
Loading…
Add table
Add a link
Reference in a new issue