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 e3eb88d
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
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 --locked --target ${{ matrix.target }}

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

- name: Post | Prepare artifacts
run: |
mkdir result
cp target/${{ matrix.target }}/debug/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 }}

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 e3eb88d

Please sign in to comment.