Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
EdenEast committed Oct 24, 2023
1 parent c6e894b commit e5872be
Show file tree
Hide file tree
Showing 2 changed files with 113 additions and 0 deletions.
94 changes: 94 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: build
on:
push:
branches:
- main
- ci/*
pull_request:
concurrency: # Spend CI time only on latest ref: https://docs.github.com/en/actions/using-jobs/using-concurrency
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
build:
name: Build binaries
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
name: tuxmux-x86_64-unknown-linux-gnu.tar.gz
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
name: tuxmux-aarch64-unknown-linux-gnu.tar.gz
- target: x86_64-apple-darwin
os: macos-latest
name: tuxmux-x86_64-apple-darwin.tar.gz
- target: aarch64-apple-darwin
os: macos-latest
name: tuxmux-aarch64-apple-darwin.tar.gz
runs-on: ${{ matrix.os }}
steps:
- name: Setup | Checkout
uses: actions/checkout@v4

- name: Setup | Rust
uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable

- name: Setup | Install cross [Linux]
if: matrix.os == 'ubuntu-latest'
uses: taiki-e/install-action@v2
with:
tool: cross

- name: Build | Build [Cargo]
if: matrix.os != 'ubuntu-latest'
run: cargo build --release --locked --target ${{ matrix.target }}

- name: Build | Build [Cross]
if: matrix.os == 'ubuntu-latest'
run: cross build --release --locked --target ${{ matrix.target }}

- name: Post | Prepare artifacts
run: |
mkdir result
cp target/${{ matrix.target }}/release/tm result
cp -r target/${{ matrix.target }}/man result
cp -r target/${{ matrix.target }}/completions result
tar czvf ${{ matrix.name }} result
- name: Release | Upload artifacts
uses: actions/upload-artifact @v3
with:
name: ${{ matrix.name }}
path: ${{ matrix.name }}

build:
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
name: tuxmux-x86_64-unknown-linux-gnu.tar.gz

- target: x86_64-unknown-linux-musl
os: ubuntu-latest
name: tuxmux-x86_64-unknown-linux-musl.tar.gz

- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
name: tuxmux-aarch64-unknown-linux-gnu.tar.gz

- target: aarch64-unknown-linux-musl
os: ubuntu-latest
name: tuxmux-aarch64-unknown-linux-musl.tar.gz

- target: x86_64-apple-darwin
os: macOS-11
name: tuxmux-x86_64-apple-darwin.zip

- target: aarch64-apple-darwin
os: macOS-11
name: tuxmux-aarch64-apple-darwin.zip
19 changes: 19 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,16 @@ jobs:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
name: tuxmux-x86_64-unknown-linux-gnu.tar.gz
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
name: tuxmux-aarch64-unknown-linux-gnu.tar.gz
- target: x86_64-apple-darwin
os: macos-latest
name: tuxmux-x86_64-apple-darwin.tar.gz
- target: aarch64-apple-darwin
os: macos-latest
name: tuxmux-aarch64-apple-darwin.tar.gz
runs-on: ${{ matrix.os }}
steps:
- name: Setup | Checkout
Expand All @@ -51,9 +59,20 @@ jobs:
with:
toolchain: stable

- name: Setup | Install cross [Linux]
if: matrix.os == 'ubuntu-latest'
uses: taiki-e/install-action@v2
with:
tool: cross

- name: Build | Build [Cargo]
if: matrix.os != 'ubuntu-latest'
run: cargo build --release --locked --target ${{ matrix.target }}

- name: Build | Build [Cross]
if: matrix.os == 'ubuntu-latest'
run: cross build --release --locked --target ${{ matrix.target }}

- name: Post | Prepare artifacts
run: |
mkdir result
Expand Down

0 comments on commit e5872be

Please sign in to comment.