2022-09-19 13:41:33 +02:00
|
|
|
---
|
|
|
|
name: pre-release
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- "main"
|
|
|
|
|
|
|
|
jobs:
|
2022-09-19 15:05:39 +02:00
|
|
|
compile:
|
|
|
|
name: "Compilation"
|
2022-09-19 13:41:33 +02:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [windows-2022, ubuntu-22.04, macos-12]
|
2022-09-20 15:54:47 +02:00
|
|
|
features: ["debug,globe_view", "globe_view", "debug,render", "render", "debug", ""]
|
2022-09-19 13:41:33 +02:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Install rust toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
toolchain: nightly
|
|
|
|
override: true
|
2022-09-21 13:48:01 +02:00
|
|
|
- name: Install wayland dependency on linux
|
|
|
|
if: ${{ matrix.os == 'ubuntu-22.04' }}
|
|
|
|
run: sudo apt-get install -y libwayland-dev
|
2022-09-19 13:41:33 +02:00
|
|
|
|
|
|
|
- name: Build binary
|
|
|
|
run: |
|
|
|
|
cargo build --release --no-default-features --features=${{ matrix.features }}
|
2022-09-19 14:33:40 +02:00
|
|
|
|
2022-09-21 09:50:34 +02:00
|
|
|
- name: Upload debug & globe_view binary (Unix)
|
2022-09-19 15:05:39 +02:00
|
|
|
uses: actions/upload-artifact@v3
|
2022-09-21 09:50:34 +02:00
|
|
|
if: ${{ matrix.os != 'windows-2022' && matrix.features == 'debug,globe_view' }}
|
2022-09-20 12:25:31 +02:00
|
|
|
with:
|
2022-09-20 15:14:16 +02:00
|
|
|
name: worlds-rs-${{ matrix.os }}-debug-globe_view
|
2022-09-20 15:41:56 +02:00
|
|
|
path: |
|
|
|
|
target/release/worlds-sim-rust
|
2022-09-21 09:50:34 +02:00
|
|
|
- name: Upload debug & render binary (Unix)
|
2022-09-20 15:41:56 +02:00
|
|
|
uses: actions/upload-artifact@v3
|
2022-09-21 09:50:34 +02:00
|
|
|
if: ${{ matrix.os != 'windows-2022' && matrix.features == 'debug,render' }}
|
2022-09-20 15:41:56 +02:00
|
|
|
with:
|
|
|
|
name: worlds-rs-${{ matrix.os }}-debug-render
|
|
|
|
path: |
|
|
|
|
target/release/worlds-sim-rust
|
2022-09-21 09:50:34 +02:00
|
|
|
- name: Upload non-debug binary (Unix)
|
2022-09-20 12:25:31 +02:00
|
|
|
uses: actions/upload-artifact@v3
|
2022-09-21 09:50:34 +02:00
|
|
|
if: ${{ matrix.os != 'windows-2022' && !contains(matrix.features, ',') && matrix.features != '' }}
|
2022-09-19 15:05:39 +02:00
|
|
|
with:
|
|
|
|
name: worlds-rs-${{ matrix.os }}-${{ matrix.features }}
|
2022-09-20 15:41:56 +02:00
|
|
|
path: |
|
2022-09-21 09:50:34 +02:00
|
|
|
target/release/worlds-sim-rust
|
|
|
|
- name: Upload basic binary (Unix)
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
if: ${{ matrix.os != 'windows-2022' && matrix.features == '' }}
|
|
|
|
with:
|
|
|
|
name: worlds-rs-${{ matrix.os }}-minimal
|
|
|
|
path: |
|
2022-09-20 15:41:56 +02:00
|
|
|
target/release/worlds-sim-rust
|
2022-09-19 15:05:39 +02:00
|
|
|
|
2022-09-21 09:50:34 +02:00
|
|
|
- name: Upload debug & globe_view binary (Windows)
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
if: ${{ matrix.os == 'windows-2022' && matrix.features == 'debug,globe_view' }}
|
|
|
|
with:
|
|
|
|
name: worlds-rs-${{ matrix.os }}-debug-globe_view
|
|
|
|
path: |
|
|
|
|
target/release/worlds-sim-rust.exe
|
|
|
|
- name: Upload debug & render binary (Windows)
|
2022-09-19 14:33:40 +02:00
|
|
|
uses: actions/upload-artifact@v3
|
2022-09-21 09:50:34 +02:00
|
|
|
if: ${{ matrix.os == 'windows-2022' && matrix.features == 'debug,render' }}
|
|
|
|
with:
|
|
|
|
name: worlds-rs-${{ matrix.os }}-debug-render
|
|
|
|
path: |
|
|
|
|
target/release/worlds-sim-rust.exe
|
|
|
|
- name: Upload non-debug binary (Windows)
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
if: ${{ matrix.os == 'windows-2022' && !contains(matrix.features, ',') && matrix.features != '' }}
|
|
|
|
with:
|
|
|
|
name: worlds-rs-${{ matrix.os }}-${{ matrix.features }}
|
|
|
|
path: |
|
|
|
|
target/release/worlds-sim-rust.exe
|
|
|
|
- name: Upload basic binary (Windows)
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
if: ${{ matrix.os == 'windows-2022' && matrix.features == '' }}
|
2022-09-19 15:05:39 +02:00
|
|
|
with:
|
2022-09-20 15:41:56 +02:00
|
|
|
name: worlds-rs-${{ matrix.os }}-minimal
|
|
|
|
path: |
|
|
|
|
target/release/worlds-sim-rust.exe
|
2022-09-19 15:05:39 +02:00
|
|
|
|
2022-09-20 15:41:56 +02:00
|
|
|
create-tag:
|
|
|
|
name: "Create tag"
|
|
|
|
runs-on: ubuntu-22.04
|
2022-09-21 13:48:01 +02:00
|
|
|
needs: [compile]
|
2022-09-20 15:41:56 +02:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: rickstaa/action-create-tag@v1
|
|
|
|
with:
|
2022-09-21 09:50:34 +02:00
|
|
|
tag: latest
|
2022-09-20 15:41:56 +02:00
|
|
|
message: "Latest pre-release"
|
2022-09-20 16:06:58 +02:00
|
|
|
force_push_tag: true
|
2022-09-19 15:05:39 +02:00
|
|
|
|
2022-09-20 15:41:56 +02:00
|
|
|
create-release:
|
|
|
|
name: "Create release"
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
needs: [compile, create-tag]
|
|
|
|
steps:
|
|
|
|
- uses: actions/download-artifact@v3
|
|
|
|
with:
|
2022-09-21 09:50:34 +02:00
|
|
|
path: /tmp/downloads/
|
2022-09-19 15:05:39 +02:00
|
|
|
|
2022-09-21 09:50:34 +02:00
|
|
|
- name: Create packaged files
|
2022-09-20 16:02:59 +02:00
|
|
|
run: |
|
2022-09-21 09:50:34 +02:00
|
|
|
cd /tmp/downloads/
|
|
|
|
for dir in */; do
|
|
|
|
echo "creating $(pwd)/${dir%/}.zip"
|
|
|
|
( cd "$dir" && zip -9 -r ../"${dir%/}".zip . )
|
|
|
|
echo "created $(pwd)/${dir%/}.zip"
|
|
|
|
file "$(pwd)/${dir%/}.zip"
|
|
|
|
done
|
|
|
|
cd -
|
|
|
|
|
|
|
|
- name: List all artifact files
|
|
|
|
run: ls -la --color=auto /tmp/downloads/*.zip
|
2022-09-20 16:02:59 +02:00
|
|
|
|
2022-09-21 09:50:34 +02:00
|
|
|
- uses: actions/checkout@v3
|
2022-09-20 15:41:56 +02:00
|
|
|
- name: Upload binaries
|
2022-09-21 09:50:34 +02:00
|
|
|
uses: marvinpinto/action-automatic-releases@v1.2.1
|
|
|
|
with:
|
|
|
|
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
|
|
|
title: "Latest build"
|
|
|
|
prerelease: true
|
|
|
|
files: |
|
|
|
|
/tmp/downloads/*.zip
|
|
|
|
automatic_release_tag: latest
|