v0.0.15 #16
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: App Release | |
on: | |
release: | |
types: [created] | |
permissions: | |
contents: write | |
issues: write | |
pull-requests: write | |
actions: write | |
deployments: write | |
packages: write | |
repository-projects: write | |
security-events: write | |
statuses: write | |
jobs: | |
build: | |
name: Build and release for ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [linux-latest, windows-latest, macos-latest] | |
include: | |
- os: linux-latest | |
target: x86_64-unknown-linux-gnu | |
name: raft-linux-x86_64-musl.tar.gz | |
bin: raft | |
- os: windows-latest | |
target: x86_64-pc-windows-msvc | |
name: raft-windows-x86_64-msvc.zip | |
bin: raft.exe | |
- os: macos-latest | |
target: x86_64-apple-darwin | |
name: raft-macos-x86_64.tar.gz | |
bin: raft | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Rust | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
target: ${{ matrix.target }} | |
- name: Install musl tools for Linux | |
if: matrix.os == 'linux-latest' | |
run: sudo apt-get update --yes && sudo ap install -y musl-tools | |
- name: Build | |
run: cargo build --release --target ${{ matrix.target }} | |
- name: Package as archive | |
shell: bash | |
if: matrix.os == 'linux-latest' || matrix.os == 'macos-latest' | |
run: | | |
cd target/${{ matrix.target }}/release/ | |
if [[ ${{ matrix.os }} == 'windows-latest' ]]; then | |
7z a ../../../raft-${{ matrix.target }}.zip ${{ matrix.bin }} | |
else | |
tar -czf ../../../raft-${{ matrix.target }}.tar.gz -C target/${{ matrix.target }}/release/ ${{ matrix.bin }} | |
fi | |
- name: Publish release artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: raft_${{ matrix.target }} | |
path: "raft*" | |
- name: Publish GitHub release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: raft* | |
draft: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |