Skip to content

Update Cargo.toml and the README #78

Update Cargo.toml and the README

Update Cargo.toml and the README #78

Workflow file for this run

on:
push:
branches:
- master
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
release:
name: ${{ matrix.platform.release_for }}
strategy:
matrix:
platform:
- release_for: Windows-x86_64
os: windows-latest
target: x86_64-pc-windows-msvc
bin: skysongbuilder.exe
name: skysongbuilder-windows-x86_64.zip
command: both
- release_for: macOS-x86_64
os: macOS-latest
target: x86_64-apple-darwin
bin: skysongbuilder
name: skysongbuilder-macos-x86_64.tar.gz
command: both
- release_for: Linux-x86_64
os: ubuntu-20.04
target: x86_64-unknown-linux-musl
bin: skysongbuilder
name: skysongbuilder-linux-x86_64-musl.tar.gz
toolchain:
- stable
runs-on: ${{ matrix.platform.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache cargo & target directories
uses: Swatinem/rust-cache@v2
- name: Install musl-tools on Linux
run: sudo apt-get update --yes && sudo apt-get install --yes musl-dev musl-tools && sudo ln -s /bin/g++ /bin/musl-g++
if: contains(matrix.platform.name, 'musl')
- name: Build binary
uses: houseabsolute/actions-rust-cross@v0
with:
command: ${{ matrix.platform.command }}
target: ${{ matrix.platform.target }}
args: "--locked --release"
strip: true
- name: Publish artifacts
uses: actions/upload-artifact@v3
with:
name: skysongbuilder-${{ matrix.platform.target }}
path: "target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }}"
if: matrix.toolchain == 'stable'
- name: Package as archive
shell: bash
run: |
cd target/${{ matrix.platform.target }}/release
if [[ "${{ matrix.platform.os }}" == "windows-latest" ]]; then
7z a ../../../${{ matrix.platform.name }} ${{ matrix.platform.bin }}
else
tar czvf ../../../${{ matrix.platform.name }} ${{ matrix.platform.bin }}
fi
cd -
if: matrix.toolchain == 'stable' && startsWith( github.ref, 'refs/tags/v' )
- name: Publish GitHub release
uses: softprops/action-gh-release@v1
with:
draft: true
files: "skysongbuilder-*"
if: matrix.toolchain == 'stable' && startsWith( github.ref, 'refs/tags/v' )