Skip to content

Release

Release #44

Workflow file for this run

name: Release
on:
release:
types: [created]
branches: [main]
env:
CARGO_TERM_COLOR: always
jobs:
build-and-upload-linux:
runs-on: ubuntu-latest
if: startsWith(github.event.release.tag_name, 'v')
steps:
- name: Checkout to the latest version
uses: actions/checkout@v4
- name: Build
run: cargo build --release --verbose
- name: Test
run: cargo test --all --release
- name: Install cargo deb
run: cargo install cargo-deb --version 2.4.0 --force
- name: Build .deb package
run: cargo deb
- name: Install cargo generate rpm
run: cargo install cargo-generate-rpm --version 0.14.1 --force
- name: Build .rpm package
run: cargo generate-rpm
- name: Rename before upload
run: mv target/release/tw tw-x86-linux-gnu
- name: Upload artifacts to release
uses: AButler/[email protected]
with:
files: "tw-x86-linux-gnu;./target/debian/*.deb;./target/generate-rpm/*.rpm"
repo-token: ${{ secrets.GITHUB_TOKEN }}
build-and-upload-linux-armv7:
runs-on: ubuntu-latest
if: startsWith(github.event.release.tag_name, 'v')
steps:
- name: Checkout to the latest version
uses: actions/checkout@v4
- name: Install build tools
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends build-essential libzstd-dev gcc-arm-linux-gnueabihf libc6-dev-armhf-cross
- name: Install Rust
run: rustup target add armv7-unknown-linux-gnueabihf
- name: Build
run: |
export CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc
cargo build --release --verbose --target armv7-unknown-linux-gnueabihf
- name: Test
run: cargo test --all --release
- name: Rename before upload
run: mv target/armv7-unknown-linux-gnueabihf/release/tw tw-armv7-unknown-linux-gnueabihf
- name: Upload artifacts to release
uses: AButler/[email protected]
with:
files: tw-armv7-unknown-linux-gnueabihf
repo-token: ${{ secrets.GITHUB_TOKEN }}
build-and-upload-linux-aarch64:
runs-on: ubuntu-latest
if: startsWith(github.event.release.tag_name, 'v')
steps:
- name: Checkout to the latest version
uses: actions/checkout@v4
- name: Install build tools
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends build-essential libzstd-dev gcc-aarch64-linux-gnu libc6-dev-arm64-cross
- name: Install Rust
run: rustup target add aarch64-unknown-linux-gnu
- name: Build
run: |
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc
cargo build --release --verbose --target aarch64-unknown-linux-gnu
- name: Test
run: cargo test --all --release
- name: Rename before upload
run: mv target/aarch64-unknown-linux-gnu/release/tw tw-aarch64-unknown-linux-gnu
- name: Upload artifacts to release
uses: AButler/[email protected]
with:
files: tw-aarch64-unknown-linux-gnu
repo-token: ${{ secrets.GITHUB_TOKEN }}
# build-and-upload-windows:
# if: startsWith(github.event.release.tag_name, 'v')
# strategy:
# matrix:
# os: [windows-latest]
# target: [i686-pc-windows-msvc, x86_64-pc-windows-msvc]
# runs-on: ${{ matrix.os }}
# steps:
# - name: Checkout to the latest version
# uses: actions/checkout@v4
# - name: Build
# run: cargo build --release --verbose --target ${{ matrix.target }}
# - name: Test
# run: cargo test --all --release
# - name: Rename before upload
# run: mv target/${{ matrix.target }}/release/tw.exe tw-${{matrix.target}}.exe
# shell: powershell
# - name: Upload artifacts to release
# uses: AButler/[email protected]
# with:
# files: tw-${{matrix.target}}.exe
# repo-token: ${{ secrets.GITHUB_TOKEN }}
build-and-upload-macos:
if: startsWith(github.event.release.tag_name, 'v')
strategy:
matrix:
os: [macos-latest]
target: [aarch64-apple-darwin]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout to the latest version
uses: actions/checkout@v4
- name: Build
run: cargo build --release --verbose --target ${{ matrix.target }}
- name: Test
run: cargo test --all --release
- name: Rename before upload
run: mv target/${{ matrix.target }}/release/tw tw-${{matrix.target}}
- name: Upload artifacts to release
uses: AButler/[email protected]
with:
files: tw-${{matrix.target}}
repo-token: ${{ secrets.GITHUB_TOKEN }}
upload-to-crates-io:
if: startsWith(github.event.release.tag_name, 'v')
runs-on: ubuntu-latest
needs: [build-and-upload-linux,build-and-upload-linux-armv7, build-and-upload-linux-aarch64, build-and-upload-macos, build-and-upload-windows]

Check failure on line 173 in .github/workflows/release.yml

View workflow run for this annotation

GitHub Actions / Release

Invalid workflow file

The workflow is not valid. .github/workflows/release.yml (Line: 173, Col: 122): Job 'upload-to-crates-io' depends on unknown job 'build-and-upload-windows'.
steps:
- name: Checkout to the latest version
uses: actions/checkout@v4
- name: Local install
run: cargo install --path .
- name: Publish to crates.io
run: cargo publish --token ${{ secrets.CRATES_TOKEN }}