1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Release
on:
push:
tags:
workflow_dispatch:
permissions:
contents: write
jobs:
build:
name: ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: macos-latest
target: aarch64-apple-darwin
# Intel-mac runners (macos-13) are retired; cross-compile on Apple Silicon.
- os: macos-latest
target: x86_64-apple-darwin
- os: windows-latest
target: x86_64-pc-windows-msvc
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
- run: cargo build --release --target ${{ matrix.target }}
- name: Package (unix)
if: runner.os != 'Windows'
run: |
cd target/${{ matrix.target }}/release
tar czf tableski-${{ github.ref_name }}-${{ matrix.target }}.tar.gz tableski
- name: Package (windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
cd target/${{ matrix.target }}/release
Compress-Archive -Path tableski.exe -DestinationPath "tableski-${{ github.ref_name }}-${{ matrix.target }}.zip"
- name: Attach to release
uses: softprops/action-gh-release@v2
with:
prerelease: ${{ contains(github.ref_name, '-') }}
files: |
target/${{ matrix.target }}/release/tableski-*.tar.gz
target/${{ matrix.target }}/release/tableski-*.zip