From b42c12fa2e4e5ba25f2e4d5dfe36692fc0f01112 Mon Sep 17 00:00:00 2001 From: Andrew Helwer <2n8rn1w1f@mozmail.com> Date: Wed, 4 Jan 2023 19:46:40 -0500 Subject: [PATCH] Now attach prebuilt binaries to github release --- .github/workflows/release.yml | 58 +++++++++++++++++++++++++---------- Cargo.toml | 2 +- README.md | 7 +++-- 3 files changed, 47 insertions(+), 20 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 522cdb6..73ce4ef 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,33 +3,59 @@ on: release: types: [created] jobs: - rust-crate: + publish-rust-crate: runs-on: ubuntu-latest steps: - name: Clone repo uses: actions/checkout@v3 - with: - submodules: recursive - name: Install Rust uses: actions-rs/toolchain@v1 with: toolchain: stable - - name: Build + - name: Publish uses: actions-rs/cargo@v1 with: - command: build - - name: Check Formatting - uses: actions-rs/cargo@v1 + command: publish + args: --token ${{secrets.CRATES_AUTH_TOKEN}} + github-release-binaries: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + include: + - os: ubuntu-latest + binname: tlauc-linux.tar.gz + - os: macos-latest + binname: tlauc-macos.tar.gz + - os: windows-latest + binname: tlauc-windows.zip + fail-fast: false + steps: + - name: Clone repo + uses: actions/checkout@v3 + - name: Install Rust + uses: actions-rs/toolchain@v1 with: - command: fmt - args: --check - - name: Test + toolchain: stable + - name: Build uses: actions-rs/cargo@v1 with: - command: test - args: -- --nocapture - - name: Publish - uses: actions-rs/cargo@v1 + command: build + args: --release + - name: Package Binary + if: matrix.os == 'windows-latest' + shell: pwsh + run: Compress-Archive -Path target/release/tlauc.exe -DestinationPath ${{ matrix.binname }} + - name: Package Binary + if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' + run: tar -czvf ${{ matrix.binname }} -C target/release tlauc + - name: Upload Binary + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GH_PAT }} with: - command: publish - args: --token ${{secrets.CRATES_AUTH_TOKEN}} + upload_url: ${{ github.event.release.upload_url }} + asset_path: ${{ matrix.binname }} + asset_name: ${{ matrix.binname }} + asset_content_type: application/gzip + diff --git a/Cargo.toml b/Cargo.toml index dfdfab3..a04645d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "tlauc" description = "Rewrites TLA⁺ specs to use Unicode symbols instead of ASCII, and vice-versa" -version = "0.1.1" +version = "0.1.2" authors = ["Andrew Helwer <2n8rn1w1f@mozmail.com>"] repository = "https://github.com/tlaplus-community/tlauc" license = "MIT" diff --git a/README.md b/README.md index 8c39926..454fdb5 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ For an optimal TLA⁺ Unicode experience you'll want a monospace font that rende This crate contains both a library and its command line wrapper. -To install the command line tool: +To get the command line tool; either download it directly from [a release](https://github.com/tlaplus-community/tlauc/releases/latest) or install it with `cargo`: 1. Install rust: https://www.rust-lang.org/tools/install 1. Run `cargo install tlauc` 1. Ensure the [cargo installation directory](https://doc.rust-lang.org/cargo/commands/cargo-install.html#description) is on your path @@ -245,6 +245,7 @@ The block comment edge case has not been observed in the wild and so is not yet ## Prior Art -[Ron Pressler](https://pron.github.io/) did some work in early 2017 trying to add Unicode support to SANY; unfortunately this work was not successfully merged. -He also wrote [a similar Unicode conversion tool](https://github.com/pron/tlaplus/tree/unicode-presentation-2/tlatools/src/tla2unicode), which faced many of the same challenges around jlist alignment. +[Ron Pressler](https://pron.github.io/) did some work in early 2017 trying to add Unicode support to SANY. +He also wrote [a similar Unicode conversion tool](https://github.com/pron/tlaplus/tree/unicode-presentation-2/tlatools/src/tla2unicode) in Java, which faced many of the same challenges around jlist alignment. +Unfortunately none of this work was upstreamed.