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
|
2020-11-30 03:01:18 +03:00
|
|
|
|
2019-12-23 22:51:22 +03:00
|
|
|
name: Build
|
|
|
|
on: [push]
|
|
|
|
jobs:
|
2020-11-30 03:01:18 +03:00
|
|
|
build:
|
|
|
|
name: Build everything for ${{ matrix.os }}
|
2019-12-27 02:52:25 +03:00
|
|
|
if: "contains(github.event.head_commit.message, '[rebuild]')"
|
2020-11-30 03:01:18 +03:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
build: [linux, macos, windows]
|
|
|
|
include:
|
|
|
|
- build: linux
|
2021-03-08 19:30:14 +03:00
|
|
|
os: ubuntu-18.04
|
2020-11-30 03:01:18 +03:00
|
|
|
- build: macos
|
|
|
|
os: macos-latest
|
|
|
|
- build: windows
|
|
|
|
os: windows-latest
|
|
|
|
|
2019-12-27 02:52:25 +03:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@master
|
2020-11-30 03:01:18 +03:00
|
|
|
|
2019-12-27 02:52:25 +03:00
|
|
|
- uses: hecrj/setup-rust-action@v1
|
|
|
|
with:
|
2021-07-30 19:48:31 +03:00
|
|
|
rust-version: 1.54.0
|
2020-11-30 03:01:18 +03:00
|
|
|
|
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.
|
2020-11-30 03:01:18 +03:00
|
|
|
key: build-${{ matrix.os }}
|
|
|
|
|
|
|
|
- name: Detect release
|
|
|
|
shell: bash
|
|
|
|
run: if [[ `git log -1 --pretty=format:"%s"` == *"[release]"* ]]; then echo 'features=--features=map_gui/release_s3' >> $GITHUB_ENV; else echo 'features=' >> $GITHUB_ENV; fi
|
|
|
|
|
2020-12-10 05:24:47 +03:00
|
|
|
- name: Install dependencies
|
2021-03-08 19:30:14 +03:00
|
|
|
if: matrix.os == 'ubuntu-18.04'
|
2021-05-31 21:01:43 +03:00
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install libasound2-dev libxcb-shape0-dev libxcb-xfixes0-dev libpango1.0-dev libgtk-3-dev
|
2020-12-10 05:24:47 +03:00
|
|
|
|
2020-05-17 19:25:44 +03:00
|
|
|
- name: Build game
|
2020-11-08 06:11:50 +03:00
|
|
|
working-directory: game
|
2020-11-30 03:01:18 +03:00
|
|
|
run: cargo build --release ${features}
|
2020-12-19 21:01:28 +03:00
|
|
|
- name: Build santa
|
|
|
|
working-directory: santa
|
2020-11-30 03:01:18 +03:00
|
|
|
run: cargo build --release ${features}
|
|
|
|
- name: Build fifteen_min
|
|
|
|
working-directory: fifteen_min
|
|
|
|
run: cargo build --release ${features}
|
|
|
|
- name: Build osm_viewer
|
|
|
|
working-directory: osm_viewer
|
|
|
|
run: cargo build --release ${features}
|
|
|
|
- name: Build parking_mapper
|
|
|
|
working-directory: parking_mapper
|
|
|
|
run: cargo build --release ${features}
|
|
|
|
|
2021-03-16 00:16:18 +03:00
|
|
|
- name: Build other tools
|
2021-04-13 23:39:50 +03:00
|
|
|
run: cargo build --release --bin importer --bin one_step_import --bin geojson_to_osmosis --bin pick_geofabrik --bin clip_osm --bin import_grid2demand
|
2020-11-30 03:01:18 +03:00
|
|
|
|
|
|
|
- name: Download system data
|
2021-04-20 21:41:02 +03:00
|
|
|
run: cargo run --release --bin updater -- --minimal
|
2020-11-30 03:01:18 +03:00
|
|
|
|
2020-06-11 02:20:16 +03:00
|
|
|
- name: Package release
|
2020-11-30 03:01:18 +03:00
|
|
|
run: ./release/build.sh ${{ matrix.os }}
|
2020-06-11 02:20:16 +03:00
|
|
|
shell: bash
|
2020-11-30 03:01:18 +03:00
|
|
|
|
|
|
|
- name: Upload release for Linux
|
2021-03-08 19:30:14 +03:00
|
|
|
if: matrix.os == 'ubuntu-18.04'
|
2020-11-30 03:01:18 +03:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: abst_linux
|
|
|
|
path: abst_linux.zip
|
|
|
|
- name: Upload release for Mac
|
|
|
|
if: matrix.os == 'macos-latest'
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: abst_mac
|
|
|
|
path: abst_mac.zip
|
|
|
|
- name: Upload release for Windows
|
|
|
|
if: matrix.os == 'windows-latest'
|
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-11-30 03:01:18 +03:00
|
|
|
|
|
|
|
- name: Upload just the binary for Windows
|
|
|
|
if: matrix.os == 'windows-latest'
|
2020-09-15 01:07:23 +03:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: abst_windows_binary
|
|
|
|
path: target/release/game.exe
|
2020-11-30 03:01:18 +03:00
|
|
|
|
|
|
|
- name: Upload just the binary for Mac
|
|
|
|
if: matrix.os == 'macos-latest'
|
2020-09-15 01:07:23 +03:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: abst_mac_binary
|
|
|
|
path: target/release/game
|