Feature/syntax highlighting (#75) #27
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: release | |
on: | |
push: | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+" | |
jobs: | |
release: | |
permissions: | |
contents: write | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
- os: ubuntu-latest | |
target: aarch64-unknown-linux-gnu | |
- os: macos-latest | |
target: x86_64-apple-darwin | |
- os: macos-latest | |
target: aarch64-apple-darwin | |
- os: windows-latest | |
target: x86_64-pc-windows-msvc | |
- os: windows-latest | |
target: aarch64-pc-windows-msvc | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: setup rust | |
run: rustup toolchain install stable --profile minimal | |
- name: add targets | |
run: rustup target add ${{ matrix.target }} | |
- name: install gcc for linux target | |
if: matrix.target == 'aarch64-unknown-linux-gnu' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -yq gcc-aarch64-linux-gnu | |
- name: setup rust cache | |
uses: Swatinem/rust-cache@v2 | |
- name: build target | |
env: | |
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: /usr/bin/aarch64-linux-gnu-gcc | |
run: cargo build --release --locked --target ${{ matrix.target }} | |
- name: pack unix artifacts | |
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' | |
env: | |
TARGET_NAME: yeet-${{ matrix.target }} | |
run: | | |
mkdir $TARGET_NAME | |
cp target/${{ matrix.target }}/release/yeet $TARGET_NAME | |
cp README.md LICENSE $TARGET_NAME | |
zip -r $TARGET_NAME.zip $TARGET_NAME | |
- name: pack win artifacts | |
if: matrix.os == 'windows-latest' | |
env: | |
TARGET_NAME: yeet-${{ matrix.target }} | |
run: | | |
New-Item -ItemType Directory -Path ${env:TARGET_NAME} | |
Copy-Item -Path "target\${{ matrix.target }}\release\yeet.exe" -Destination ${env:TARGET_NAME} | |
Copy-Item -Path "README.md", "LICENSE" -Destination ${env:TARGET_NAME} | |
Compress-Archive -Path ${env:TARGET_NAME} -DestinationPath "${env:TARGET_NAME}.zip" | |
- name: release on gh | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
draft: true | |
files: | | |
yeet-${{ matrix.target }}.zip | |
generate_release_notes: true |