Release v0.1.8 (#152) #15
Workflow file for this run
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
# reference: | |
# https://dzfrias.dev/blog/deploy-rust-cross-platform-github-actions | |
name: deploy | |
on: | |
push: | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+" | |
jobs: | |
build-and-upload: | |
name: build and upload | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- build: linux-x86 | |
os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
- build: linux-arm | |
os: ubuntu-latest | |
target: aarch64-unknown-linux-gnu | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: nightly-2023-06-30 # duplicated in rust-toolchain.toml | |
targets: "${{ matrix.target }},wasm32-unknown-unknown" | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
# Additional non workspace directories to be cached, separated by newlines. | |
cache-directories: "" | |
- name: install several build tools | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: mdbook,cross,cargo-binstall | |
- name: install trunk | |
run: cargo binstall -y trunk | |
- name: get the release version from the tag | |
shell: bash | |
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
- name: build docs | |
run: cd docs && mdbook build | |
- name: build app | |
run: cd app && trunk build --release | |
- name: build server | |
uses: actions-rs/cargo@v1 | |
with: | |
use-cross: true | |
command: build | |
args: --release --target ${{ matrix.target }} --bin buenzlimarks | |
- name: build archive | |
shell: bash | |
run: | | |
# Replace with the name of your binary | |
binary_name="buenzlimarks" | |
dirname="$binary_name-${{ env.VERSION }}-${{ matrix.target }}" | |
mkdir "$dirname" | |
mv "target/${{ matrix.target }}/release/$binary_name" "$dirname" | |
tar -czf "$dirname.tar.gz" "$dirname" | |
echo "ASSET=$dirname.tar.gz" >> $GITHUB_ENV | |
- name: upload the binaries | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: ${{ env.ASSET }} |