chore: rename parser #29
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: Build | |
on: | |
push: | |
branches: ["master"] | |
pull_request: | |
branches: ["master"] | |
env: | |
CARGO_TERM_COLOR: always | |
VERSION: none | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- run: rustup toolchain install stable --profile minimal | |
- uses: Swatinem/rust-cache@v2 | |
- name: Metadata | |
run: cargo metadata --no-deps --format-version 1 > metadata.json | |
- name: Extract Version | |
run: | | |
echo "VERSION=$(jq -r '.packages[0].version' metadata.json)" >> $env:GITHUB_ENV | |
echo "VERSION=$(jq -r '.packages[0].version' metadata.json)" >> $GITHUB_ENV | |
- name: Build | |
run: cargo build --release --verbose | |
- name: Run tests | |
run: cargo test --release --verbose | |
- name: Package for macOS/Linux | |
if: runner.os != 'Windows' | |
run: | | |
mkdir -p release | |
zip -r "release/lunar-stitch-${{ env.VERSION }}-${{ runner.os }}.zip" target/release/lunar-stitch | |
- name: Package for Windows | |
if: runner.os == 'Windows' | |
run: | | |
mkdir -p release | |
powershell -Command "Compress-Archive -Path target/release/lunar-stitch.exe -DestinationPath release/lunar-stitch-${{ env.VERSION }}-windows.zip" | |
- name: Release | |
if: env.VERSION != 'none' | |
uses: softprops/action-gh-release@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag_name: ${{ env.VERSION }} | |
files: release/* |