mirror of
https://github.com/Xevion/rust-sdl2-emscripten.git
synced 2025-12-05 23:16:13 -06:00
Combine builds into single workflow file
This commit is contained in:
@@ -1,19 +1,102 @@
|
||||
name: Windows
|
||||
name: Build
|
||||
|
||||
on: [push]
|
||||
|
||||
env:
|
||||
SDL2: 2.30.2
|
||||
SDL2_TTF: 2.22.0
|
||||
SDL2_MIXER: 2.8.0
|
||||
SDL2_IMAGE: 2.8.2
|
||||
SDL2_GFX: 1.0.4
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
build:
|
||||
wasm:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Emscripten SDK
|
||||
uses: mymindstorm/setup-emsdk@v11
|
||||
with:
|
||||
version: 3.1.43
|
||||
|
||||
- name: Setup Rust (WASM32 Emscripten)
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
target: wasm32-unknown-emscripten
|
||||
override: true
|
||||
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v3
|
||||
with:
|
||||
version: 8
|
||||
run_install: true
|
||||
|
||||
- name: Build
|
||||
run: ./scripts/build.sh -er # release mode, skip emsdk
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-pages-artifact@v2
|
||||
with:
|
||||
path: './dist/'
|
||||
if-no-files-found: error
|
||||
retention-days: 7
|
||||
|
||||
- name: Deploy
|
||||
uses: actions/deploy-pages@v2
|
||||
|
||||
linux:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install SDL2 Packages
|
||||
run: sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libsdl2-gfx-dev
|
||||
|
||||
- name: Setup Rust Toolchain (Linux)
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
target: x86_64-unknown-linux-gnu
|
||||
override: true
|
||||
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
|
||||
- name: Build
|
||||
run: cargo build --release
|
||||
|
||||
- name: Assemble Archive
|
||||
run: |
|
||||
mkdir /tmp/example/
|
||||
cp ./target/release/pacman /tmp/example/
|
||||
chmod a+x /tmp/example/pacman
|
||||
mkdir /tmp/example/assets
|
||||
cp ./assets/TerminalVector.ttf ./assets/tetris.ogg ./assets/fruit.png /tmp/example/assets
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: linux
|
||||
path: /tmp/example/
|
||||
retention-days: 7
|
||||
if-no-files-found: error
|
||||
|
||||
windows:
|
||||
env:
|
||||
SDL2: 2.30.2
|
||||
SDL2_TTF: 2.22.0
|
||||
SDL2_MIXER: 2.8.0
|
||||
SDL2_IMAGE: 2.8.2
|
||||
SDL2_GFX: 1.0.4
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
46
.github/workflows/linux.yaml
vendored
46
.github/workflows/linux.yaml
vendored
@@ -1,46 +0,0 @@
|
||||
name: Linux
|
||||
|
||||
on: [push]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install SDL2 Packages
|
||||
run: sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libsdl2-gfx-dev
|
||||
|
||||
- name: Setup Rust Toolchain (Linux)
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
target: x86_64-unknown-linux-gnu
|
||||
override: true
|
||||
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
|
||||
- name: Build
|
||||
run: cargo build --release
|
||||
|
||||
- name: Assemble Archive
|
||||
run: |
|
||||
mkdir /tmp/example/
|
||||
cp ./target/release/pacman /tmp/example/
|
||||
chmod a+x /tmp/example/pacman
|
||||
mkdir /tmp/example/assets
|
||||
cp ./assets/TerminalVector.ttf ./assets/tetris.ogg ./assets/fruit.png /tmp/example/assets
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: linux
|
||||
path: /tmp/example/
|
||||
retention-days: 7
|
||||
if-no-files-found: error
|
||||
52
.github/workflows/wasm.yaml
vendored
52
.github/workflows/wasm.yaml
vendored
@@ -1,52 +0,0 @@
|
||||
name: WebAssembly (GitHub Pages)
|
||||
|
||||
on: [push]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Emscripten SDK
|
||||
uses: mymindstorm/setup-emsdk@v11
|
||||
with:
|
||||
version: 3.1.43
|
||||
|
||||
- name: Setup Rust (WASM32 Emscripten)
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
target: wasm32-unknown-emscripten
|
||||
override: true
|
||||
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v3
|
||||
with:
|
||||
version: 8
|
||||
run_install: true
|
||||
|
||||
- name: Build
|
||||
run: ./scripts/build.sh -er # release mode, skip emsdk
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-pages-artifact@v2
|
||||
with:
|
||||
path: './dist/'
|
||||
if-no-files-found: error
|
||||
retention-days: 7
|
||||
|
||||
- name: Deploy
|
||||
uses: actions/deploy-pages@v2
|
||||
Reference in New Issue
Block a user