fix a bug in under under #18
This file contains hidden or 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 Latest | |
on: | |
push: | |
branches: ["main"] | |
env: | |
CARGO_TERM_COLOR: always | |
permissions: | |
contents: write | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
# Test the interpreter | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run interpreter tests | |
run: cargo test --lib | |
# Create the release without assets | |
create_release: | |
name: Create release | |
needs: test | |
runs-on: ubuntu-latest | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Delete old release | |
run: gh release delete latest --yes || true | |
- name: Prepare release notes | |
run: echo "This release contains binaries for the latest \`main\` branch." >> release_notes.md | |
- name: Create release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: latest | |
name: Latest Build | |
body_path: ./release_notes.md | |
prerelease: true | |
# Create the binaries and upload them as release assets | |
create_binaries: | |
name: Create binary | |
needs: [test, create_release] | |
runs-on: ${{ matrix.os }} | |
env: | |
BINARY_EXT: ${{ matrix.os == 'windows-latest' && '.exe' || '' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- { os: macos-latest, target: x86_64-apple-darwin, features: "audio,window" } | |
- { os: macos-latest, target: aarch64-apple-darwin, features: "audio,window" } | |
- { os: ubuntu-latest, target: x86_64-unknown-linux-gnu, features: "full" } | |
- { os: ubuntu-latest, target: x86_64-unknown-linux-gnu, features: "window", name: "-no-audio" } | |
- { os: windows-latest, target: x86_64-pc-windows-msvc, features: "full" } | |
- { os: windows-latest, target: aarch64-pc-windows-msvc, features: "audio,window" } | |
steps: | |
- uses: actions/checkout@v4 | |
# Install dependencies | |
- if: matrix.target == 'x86_64-unknown-linux-musl' | |
run: sudo apt-get install -y musl-tools | |
- if: matrix.os == 'ubuntu-latest' | |
run: sudo apt-get install -y libasound2-dev libudev-dev libx11-dev libjpeg-dev libclang-dev | |
# Build | |
- name: Install target | |
run: rustup target add ${{matrix.target}} | |
- name: Build | |
run: cargo build --bin uiua --features ${{matrix.features}} --release --target ${{matrix.target}} --verbose | |
- name: Zip | |
run: 7z a -tzip uiua-bin-${{matrix.target}}${{matrix.name}}.zip ./target/${{matrix.target}}/release/uiua${{env.BINARY_EXT}} | |
- name: Upload release assets | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: latest | |
files: | | |
uiua-bin-${{matrix.target}}${{matrix.name}}.zip |