name: Build and upload binaries to release
on:
push:
tags:
- "v[0-9]+.*"
jobs:
create_release:
name: Create release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Set variables
id: vars
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
body: |
This is a new release of `to-html`. [Read the changelog here](https://github.com/Aloso/to-html/blob/${{ steps.vars.outputs.tag }}/CHANGELOG.md).
`to-html` is currently compatible with Linux, macOS, FreeBSD and Android. If you're using Windows, I recommend to use WSL.
### Installation
To install `to-html` on Linux or macOS, you can use the pre-built binaries below.
`to-html` is also available in the AUR, so you can install it with
```shell
yay -s to-html
```
On FreeBSD, you need to build `to-html` with Cargo, Rusts package manager. To install the Rust toolchain, [see here](https://www.rust-lang.org/tools/install). Then run
```shell
$ cargo install to-html
```
You might have to add the `.cargo/bin` folder to your `PATH` afterwards.
Please file issues if you run into any problems or have suggestions.
release_assets:
name: Release assets
needs: create_release
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
platform: linux
- os: macos-latest
platform: macos
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Print information
run: |
rustup show active-toolchain
rustc --version
cargo tree
- name: Set variables
id: vars
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
- name: Build project
env:
SHELL_COMPLETIONS_DIR: completions
run: cargo build --release --locked
- name: Upload release assets
uses: taiki-e/upload-rust-binary-action@v1
with:
bin: to-html
include: completions
asset_name: to-html_${{ matrix.platform }}_${{ steps.vars.outputs.tag }}
token: ${{ secrets.GITHUB_TOKEN }}