Rename package; Update workflow

Workflow taken from
This commit is contained in:
Tobias Berger 2022-09-30 12:57:43 +02:00
parent ca230f6a9b
commit 1654529dc0
Signed by: toby
GPG key ID: 2D05EFAB764D6A88
4 changed files with 133 additions and 110 deletions

View file

@ -1,17 +1,51 @@
---
name: pre-release
name: Release
on:
push:
branches:
- "main"
tags:
- "v*"
jobs:
compile:
name: "Compilation"
name: Build release binaries
strategy:
matrix:
os: [windows-2022, ubuntu-22.04, macos-12]
features: ["logging,globe_view", "globe_view", "logging,render", "render", "logging", ""]
include:
- target: x86_64-apple-darwin
os: macos-latest
features: globe_view
- target: aarch64-apple-darwin
os: macos-latest
features: globe_view
- target: x86_64-pc-windows-msvc
os: windows-latest
features: globe_view
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
features: globe_view
- target: x86_64-apple-darwin
os: macos-latest
features: render
- target: aarch64-apple-darwin
os: macos-latest
features: render
- target: x86_64-pc-windows-msvc
os: windows-latest
features: render
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
features: render
- target: x86_64-apple-darwin
os: macos-latest
features: ""
- target: aarch64-apple-darwin
os: macos-latest
features: ""
- target: x86_64-pc-windows-msvc
os: windows-latest
features: ""
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
features: ""
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
@ -22,103 +56,87 @@ jobs:
profile: minimal
toolchain: nightly
override: true
target: ${{ matrix.target }}
- name: Install linux dependencies
if: ${{ matrix.os == 'ubuntu-22.04' }}
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get install -y libwayland-dev libxkbcommon-dev
sudo apt-get install -y libwayland-client0 libwayland-dev libxkbcommon-dev
- name: Build binary
run: |
cargo build --release --no-default-features --features=${{ matrix.features }}
- run: cargo build --release --locked --target ${{ matrix.target }} --no-default-features --features=${{ matrix.features }}
- name: Upload logging & globe_view binary (Unix)
uses: actions/upload-artifact@v3
if: ${{ matrix.os != 'windows-2022' && matrix.features == 'logging,globe_view' }}
- name: Post-Build | Compress [Features; -nix]
if: matrix.features != '' && !contains(matrix.os, 'windows')
uses: a7ul/tar-action@v1.1.0
with:
name: worlds-rs-${{ matrix.os }}-logging-globe_view
path: |
target/release/worlds-sim-rust
- name: Upload logging & render binary (Unix)
uses: actions/upload-artifact@v3
if: ${{ matrix.os != 'windows-2022' && matrix.features == 'logging,render' }}
command: c
cwd: ./target/${{ matrix.target }}/release/
files: worlds-history-sim-rs
outPath: worlds-history-sim-rs-${{ matrix.target }}-${{ matrix.features }}.tar.gz
- name: Post-Build | Compress [Minimal; -nix]
if: matrix.features == '' && !contains(matrix.os, 'windows')
uses: a7ul/tar-action@v1.1.0
with:
name: worlds-rs-${{ matrix.os }}-logging-render
path: |
target/release/worlds-sim-rust
- name: Upload non-logging binary (Unix)
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
- 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: |
target/release/worlds-sim-rust
command: c
cwd: ./target/${{ matrix.target }}/release/
files: worlds-history-sim-rs
outPath: worlds-history-sim-rs-${{ matrix.target }}-minimal.tar.gz
- name: Upload logging & globe_view binary (Windows)
uses: actions/upload-artifact@v3
if: ${{ matrix.os == 'windows-2022' && matrix.features == 'logging,globe_view' }}
- name: Post-Build | Compress [Features; Windows]
if: matrix.features != '' && contains(matrix.os, 'windows')
uses: a7ul/tar-action@v1.1.0
with:
name: worlds-rs-${{ matrix.os }}-logging-globe_view
path: |
target/release/worlds-sim-rust.exe
- name: Upload logging & render binary (Windows)
uses: actions/upload-artifact@v3
if: ${{ matrix.os == 'windows-2022' && matrix.features == 'logging,render' }}
command: c
cwd: ./target/${{ matrix.target }}/release/
files: worlds-history-sim-rs.exe
outPath: worlds-history-sim-rs-${{ matrix.target }}-${{ matrix.features }}.tar.gz
- name: Post-Build | Compress [Minimal; Windows]
if: matrix.features == '' && contains(matrix.os, 'windows')
uses: a7ul/tar-action@v1.1.0
with:
name: worlds-rs-${{ matrix.os }}-logging-render
path: |
target/release/worlds-sim-rust.exe
- name: Upload non-logging 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 == '' }}
with:
name: worlds-rs-${{ matrix.os }}-minimal
path: |
target/release/worlds-sim-rust.exe
command: c
cwd: ./target/${{ matrix.target }}/release/
files: worlds-history-sim-rs.exe
outPath: worlds-history-sim-rs-${{ matrix.target }}-minimal.tar.gz
create-release:
name: "Create release"
runs-on: ubuntu-22.04
- name: Deploy | Upload Artifacts [Features]
if: matrix.features != ''
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: worlds-history-sim-rs-${{ matrix.target }}-${{ matrix.features }}
path: worlds-history-sim-rs-${{ matrix.target }}-${{ matrix.features }}.tar.gz
- name: Deploy | Upload Artifacts [Minimal]
if: matrix.features == ''
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: worlds-history-sim-rs-${{ matrix.target }}-minimal
path: worlds-history-sim-rs-${{ matrix.target }}-minimal.tar.gz
github-release:
name: GitHub release
runs-on: ubuntu-latest
needs: [compile]
steps:
- uses: actions/download-artifact@v3
with:
path: /tmp/downloads/
- name: Setup | Checkout
uses: actions/checkout@v3
- name: Create packaged files
run: |
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: Setup | Artifacts
uses: actions/download-artifact@v3
- name: List all artifact files
run: ls -la --color=auto /tmp/downloads/*.zip
- name: Setup | Checksums
run: for file in worlds-history-sim-rs-**/*; do openssl dgst -sha256 -r "$file" | awk '{print $1}' > "${file}.sha256"; done
- uses: actions/checkout@v3
- name: Upload binaries
- run: ls **/*
- name: Publish
uses: marvinpinto/action-automatic-releases@v1.2.1
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
title: "Latest build"
prerelease: true
prerelease: ${{ contains(github.ref_name, 'pre') }}
files: |
/tmp/downloads/*.zip
automatic_release_tag: latest
**/*.sha256
**/*.tar.gz
LICENSE

39
Cargo.lock generated
View file

@ -1001,12 +1001,11 @@ dependencies = [
[[package]]
name = "crossbeam-utils"
version = "0.8.11"
version = "0.8.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "51887d4adc7b564537b15adcfb307936f8075dfcd5f00dde9a9f1d29383682bc"
checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac"
dependencies = [
"cfg-if 1.0.0",
"once_cell",
]
[[package]]
@ -1419,9 +1418,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
[[package]]
name = "image"
version = "0.24.3"
version = "0.24.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e30ca2ecf7666107ff827a8e481de6a132a9b687ed3bb20bb1c144a36c00964"
checksum = "bd8e4fb07cf672b1642304e731ef8a6a4c7891d67bb4fd4f5ce58cd6ed86803c"
dependencies = [
"bytemuck",
"byteorder",
@ -1504,9 +1503,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]]
name = "libc"
version = "0.2.133"
version = "0.2.134"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c0f80d65747a3e43d1596c7c5492d95d5edddaabd45a7fcdb02b95f644164966"
checksum = "329c933548736bc49fd575ee68c89e8be4d260064184389a5b77517cddd99ffb"
[[package]]
name = "libloading"
@ -1937,9 +1936,9 @@ dependencies = [
[[package]]
name = "proc-macro2"
version = "1.0.43"
version = "1.0.46"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab"
checksum = "94e2ef8dbfc347b10c094890f778ee2e36ca9bb4262e86dc99cd217e35f3470b"
dependencies = [
"unicode-ident",
]
@ -2094,18 +2093,18 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
[[package]]
name = "serde"
version = "1.0.144"
version = "1.0.145"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f747710de3dcd43b88c9168773254e809d8ddbdf9653b84e2554ab219f17860"
checksum = "728eb6351430bccb993660dfffc5a72f91ccc1295abaa8ce19b27ebe4f75568b"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.144"
version = "1.0.145"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94ed3a816fb1d101812f83e789f888322c34e291f894f19590dc310963e87a00"
checksum = "81fa1584d3d1bcacd84c277a0dfe21f5b0f6accf4a23d04d4c6d61f1af522b4c"
dependencies = [
"proc-macro2",
"quote",
@ -2202,9 +2201,9 @@ checksum = "8fb1df15f412ee2e9dfc1c504260fa695c1c3f10fe9f4a6ee2d2184d7d6450e2"
[[package]]
name = "syn"
version = "1.0.100"
version = "1.0.101"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52205623b1b0f064a4e71182c3b18ae902267282930c6d5462c91b859668426e"
checksum = "e90cde112c4b9690b8cbe810cba9ddd8bc1d7472e2cae317b69e9438c1cba7d2"
dependencies = [
"proc-macro2",
"quote",
@ -2235,18 +2234,18 @@ dependencies = [
[[package]]
name = "thiserror"
version = "1.0.35"
version = "1.0.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c53f98874615aea268107765aa1ed8f6116782501d18e53d08b471733bea6c85"
checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
version = "1.0.35"
version = "1.0.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8b463991b4eab2d801e724172285ec4195c650e8ec79b149e6c2a8e6dd3f783"
checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb"
dependencies = [
"proc-macro2",
"quote",
@ -2758,7 +2757,7 @@ dependencies = [
]
[[package]]
name = "worlds-sim-rust"
name = "worlds-history-sim-rs"
version = "0.1.0"
dependencies = [
"bevy",

View file

@ -1,9 +1,12 @@
[package]
name = "worlds-sim-rust"
name = "worlds-history-sim-rs"
version = "0.1.0"
edition = "2021"
resolver = "2"
[profile]
release = { strip = "symbols", lto = "thin", opt-level = "z" }
[features]
logging = ["planet/logging"]
globe_view = ["planet/globe_view", "render"]

View file

@ -3,6 +3,9 @@ name = "planet"
version = "0.1.0"
edition = "2021"
[profile]
release = { strip = "symbols", lto = "thin", opt-level = "z" }
[features]
logging = []
globe_view = ["render"]