Release #37
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
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-arm-v6-v7-v8: | |
if: startsWith(github.event.release.tag_name, 'v') | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
target: [arm-unknown-linux-gnueabihf, armv7-unknown-linux-gnueabihf, aarch64-unknown-linux-gnu] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout to the latest version | |
uses: actions/checkout@v4 | |
- name: Install GCC | |
run: apt-get update && apt-get install -y --no-install-recommends build-essential clang llvm | |
- name: Install Rust | |
run: rustup target add ${{ matrix.target }} | |
- 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 | |
- name: Upload artifacts to release | |
uses: AButler/[email protected] | |
with: | |
files: tw-${{matrix.target}}.exe | |
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-macos, 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 }} |