2020-08-05 21:03:02 +03:00
|
|
|
# TODO
|
|
|
|
# https://github.com/Uriopass/Egregoria/blob/master/.github/workflows/release.yml
|
|
|
|
# has stuff for automating releases
|
2019-12-23 22:51:22 +03:00
|
|
|
name: Build
|
|
|
|
on: [push]
|
|
|
|
jobs:
|
2019-12-27 02:52:25 +03:00
|
|
|
build-windows:
|
|
|
|
runs-on: windows-latest
|
|
|
|
if: "contains(github.event.head_commit.message, '[rebuild]')"
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@master
|
|
|
|
- uses: hecrj/setup-rust-action@v1
|
|
|
|
with:
|
2020-10-21 20:25:55 +03:00
|
|
|
rust-version: 1.47.0
|
2020-09-17 02:26:44 +03:00
|
|
|
- name: Cache build
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: target
|
|
|
|
# The key could include hashFiles('Cargo.lock'), but cargo will figure out what can be reused.
|
|
|
|
key: ${{ runner.os }}-build
|
2020-05-17 19:25:44 +03:00
|
|
|
- name: Build game
|
2020-11-08 06:11:50 +03:00
|
|
|
working-directory: game
|
2020-11-08 06:06:33 +03:00
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
if [[ `git log -1 --pretty=format:"%s"` == *"[release]"* ]]; then features="--features=release_s3"; else features=""; fi
|
2020-11-08 06:11:50 +03:00
|
|
|
cargo build --release ${features}
|
2020-05-17 19:25:44 +03:00
|
|
|
- name: Build importer
|
|
|
|
run: cargo build --release --bin importer
|
2020-11-12 21:01:45 +03:00
|
|
|
- name: Build headless
|
|
|
|
run: cargo build --release --bin headless
|
2020-06-11 02:20:16 +03:00
|
|
|
- name: Package release
|
2020-11-12 21:01:45 +03:00
|
|
|
run: ./release/build.sh abst_windows play_abstreet.bat target/release/game.exe target/release/importer.exe target/release/headless.exe
|
2020-06-11 02:20:16 +03:00
|
|
|
shell: bash
|
|
|
|
- name: Upload release
|
2020-05-17 20:04:55 +03:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2020-06-11 02:20:16 +03:00
|
|
|
name: abst_windows
|
2020-06-21 00:04:48 +03:00
|
|
|
path: abst_windows
|
2020-09-15 01:07:23 +03:00
|
|
|
- name: Upload just the binary
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: abst_windows_binary
|
|
|
|
path: target/release/game.exe
|
2019-12-23 22:51:22 +03:00
|
|
|
build-macos:
|
|
|
|
runs-on: macos-latest
|
2019-12-24 02:00:22 +03:00
|
|
|
if: "contains(github.event.head_commit.message, '[rebuild]')"
|
2019-12-23 22:51:22 +03:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@master
|
|
|
|
- uses: hecrj/setup-rust-action@v1
|
|
|
|
with:
|
2020-10-21 20:25:55 +03:00
|
|
|
rust-version: 1.47.0
|
2020-09-17 02:26:44 +03:00
|
|
|
- name: Cache build
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: target
|
|
|
|
# The key could include hashFiles('Cargo.lock'), but cargo will figure out what can be reused.
|
|
|
|
key: ${{ runner.os }}-build
|
2020-05-17 19:25:44 +03:00
|
|
|
- name: Build game
|
2020-11-08 06:11:50 +03:00
|
|
|
working-directory: game
|
2020-11-08 06:06:33 +03:00
|
|
|
run: |
|
|
|
|
if [[ `git log -1 --pretty=format:"%s"` == *"[release]"* ]]; then features="--features=release_s3"; else features=""; fi
|
2020-11-08 06:11:50 +03:00
|
|
|
cargo build --release ${features}
|
2020-05-17 19:25:44 +03:00
|
|
|
- name: Build importer
|
|
|
|
run: cargo build --release --bin importer
|
2020-11-12 21:01:45 +03:00
|
|
|
- name: Build headless
|
|
|
|
run: cargo build --release --bin headless
|
2020-01-12 01:07:19 +03:00
|
|
|
- name: Package release
|
2020-11-12 21:01:45 +03:00
|
|
|
run: ./release/build.sh abst_mac play_abstreet.sh target/release/game target/release/importer target/release/headless
|
2020-01-12 01:07:19 +03:00
|
|
|
- name: Upload release
|
2020-05-17 20:04:55 +03:00
|
|
|
uses: actions/upload-artifact@v2
|
2019-12-23 23:17:47 +03:00
|
|
|
with:
|
2020-01-16 22:27:15 +03:00
|
|
|
name: abst_mac
|
2020-01-22 21:44:46 +03:00
|
|
|
path: abst_mac.zip
|
2020-09-15 01:07:23 +03:00
|
|
|
- name: Upload just the binary
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: abst_mac_binary
|
|
|
|
path: target/release/game
|
2019-12-23 22:51:22 +03:00
|
|
|
build-linux:
|
|
|
|
runs-on: ubuntu-latest
|
2019-12-24 02:00:22 +03:00
|
|
|
if: "contains(github.event.head_commit.message, '[rebuild]')"
|
2019-12-23 22:51:22 +03:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@master
|
|
|
|
- uses: hecrj/setup-rust-action@v1
|
|
|
|
with:
|
2020-10-21 20:25:55 +03:00
|
|
|
rust-version: 1.47.0
|
2020-07-16 21:34:46 +03:00
|
|
|
- name: Update apt
|
|
|
|
run: sudo apt-get update
|
2020-06-08 02:59:20 +03:00
|
|
|
- name: Install dependencies
|
2020-06-08 03:48:28 +03:00
|
|
|
run: sudo apt-get install xorg-dev libxcb-shape0-dev libxcb-xfixes0-dev
|
2020-09-17 02:26:44 +03:00
|
|
|
- name: Cache build
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: target
|
|
|
|
# The key could include hashFiles('Cargo.lock'), but cargo will figure out what can be reused.
|
|
|
|
key: ${{ runner.os }}-build
|
2020-05-17 19:25:44 +03:00
|
|
|
- name: Build game
|
2020-11-08 06:11:50 +03:00
|
|
|
working-directory: game
|
2020-11-08 06:06:33 +03:00
|
|
|
run: |
|
|
|
|
if [[ `git log -1 --pretty=format:"%s"` == *"[release]"* ]]; then features="--features=release_s3"; else features=""; fi
|
2020-11-08 06:11:50 +03:00
|
|
|
cargo build --release ${features}
|
2020-05-17 19:25:44 +03:00
|
|
|
- name: Build importer
|
|
|
|
run: cargo build --release --bin importer
|
2020-11-12 21:01:45 +03:00
|
|
|
- name: Build headless
|
|
|
|
run: cargo build --release --bin headless
|
2020-01-12 01:07:19 +03:00
|
|
|
- name: Package release
|
2020-11-12 21:01:45 +03:00
|
|
|
run: ./release/build.sh abst_linux play_abstreet.sh target/release/game target/release/importer target/release/headless
|
2020-01-12 01:07:19 +03:00
|
|
|
- name: Upload release
|
2020-05-17 20:04:55 +03:00
|
|
|
uses: actions/upload-artifact@v2
|
2019-12-23 23:17:47 +03:00
|
|
|
with:
|
2020-01-16 22:27:15 +03:00
|
|
|
name: abst_linux
|
2020-01-22 21:44:46 +03:00
|
|
|
path: abst_linux.zip
|
2020-09-30 19:49:05 +03:00
|
|
|
build-wasm:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: "contains(github.event.head_commit.message, '[rebuild]')"
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@master
|
|
|
|
- uses: hecrj/setup-rust-action@v1
|
|
|
|
with:
|
2020-10-21 20:25:55 +03:00
|
|
|
rust-version: 1.47.0
|
2020-10-06 01:09:12 +03:00
|
|
|
- name: Install wasm-pack
|
|
|
|
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
|
2020-09-30 19:49:05 +03:00
|
|
|
- name: Cache build
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: target
|
|
|
|
# The key could include hashFiles('Cargo.lock'), but cargo will figure out what can be reused.
|
2020-09-30 20:02:02 +03:00
|
|
|
key: wasm-build
|
2020-09-30 19:49:05 +03:00
|
|
|
- name: Build game
|
|
|
|
working-directory: game
|
2020-10-06 01:09:12 +03:00
|
|
|
run: wasm-pack build --dev --target web -- --no-default-features --features wasm
|
2020-09-30 19:49:05 +03:00
|
|
|
# TODO For now, just check that the build works. Later, build fully and package.
|