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-12-03 08:45:56 +03:00
|
|
|
rust-version: 1.57.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-09-15 05:56:16 +03:00
|
|
|
- name: Build the CLI tool
|
|
|
|
run: cargo build --release --bin cli
|
2020-11-30 03:01:18 +03:00
|
|
|
|
|
|
|
- name: Download system data
|
2021-11-01 22:46:57 +03:00
|
|
|
run: cargo run --release --bin updater -- download --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
|