amethyst_geode 1.3.0

Turing Machine Programming Language Interpreter
Documentation
name: Test, Build and Release

on:
  push:
    tags:
      - "v*"

jobs:
  test:
    name: Run Tests
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Set up Rust
        uses: actions-rs/toolchain@v1
        with:
          toolchain: stable

      - name: Run tests
        run: cargo test --test basic_parser_tests --release

  build:
    name: Build on ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    needs: test # This ensures tests must pass before building
    strategy:
      matrix:
        include:
          - os: ubuntu-latest
            target: x86_64-unknown-linux-gnu
            ext: ""
          - os: ubuntu-latest
            target: x86_64-unknown-linux-musl
            ext: ""
          - os: windows-latest
            target: x86_64-pc-windows-gnu
            ext: ".exe"
          - os: macos-latest
            target: x86_64-apple-darwin
            ext: ""
          - os: macos-latest
            target: aarch64-apple-darwin
            ext: ""

    steps:
      - uses: actions/checkout@v4

      - name: Set up Rust
        uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
          target: ${{ matrix.target }}

      - name: Build
        run: cargo build --release --target ${{ matrix.target }}

      - name: Package binary
        run: |
          mkdir -p dist
          cp target/${{ matrix.target }}/release/geode${{ matrix.ext }} dist/geode-${{ matrix.target }}${{ matrix.ext }}
        shell: bash

      - uses: actions/upload-artifact@v4
        with:
          name: ${{ matrix.target }}
          path: dist/

  release:
    name: Publish Release
    needs: build # Ensures all builds must succeed
    runs-on: ubuntu-latest
    steps:
      - uses: actions/download-artifact@v4
        with:
          path: ./artifacts

      - name: Publish GitHub Release
        uses: softprops/action-gh-release@v1
        with:
          files: ./artifacts/**/*
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}