Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/actions/xbuild-spotty/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: 'Cross-Build Spotty'
description: 'Build Spotty for any Linux platform'

inputs:
binary-name:
description: 'The name of the resulting artifact'
default: 'spotty'
client-id:
description: 'The Client ID to bake in to the binary'
required: true
target-triple:
description: 'The Rust Target Triple'
required: true

runs:
using: "composite"

steps:
- name: Write Build Configuration File
uses: DamianReeves/write-file-action@v1.0
with:
path: ./src/client_id.txt
contents: ${{ inputs.client-id }}
write-mode: overwrite

- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ inputs.target-triple }}
override: true

- name: Get Rustc version
id: get-rustc-version
run: echo "::set-output name=version::$(rustc -V)"
shell: bash

- name: Cache Rust dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git
target
key: ${{ runner.os }}-${{ steps.get-rustc-version.outputs.version }}-${{ hashFiles('Cargo.lock') }}

- uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --target ${{ inputs.target-triple }}

- uses: actions/upload-artifact@v3
with:
name: ${{ inputs.binary-name }}
path: target/${{ inputs.target-triple }}/release/spotty
76 changes: 68 additions & 8 deletions .github/workflows/build-spotty.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:

jobs:
macOS:
runs-on: macos-11.0
runs-on: macos-11

steps:
- name: Install Rust
Expand All @@ -20,7 +20,7 @@ jobs:
toolchain: stable

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Write Build Configuration File
uses: DamianReeves/write-file-action@v1.0
Expand All @@ -29,6 +29,20 @@ jobs:
contents: ${{ env.KEYMASTER_CLIENT_ID }}
write-mode: overwrite

- name: Get Rustc version
id: get-rustc-version
run: echo "::set-output name=version::$(rustc -V)"

- name: Cache Rust dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git
target
key: ${{ runner.os }}-${{ steps.get-rustc-version.outputs.version }}-${{ hashFiles('Cargo.lock') }}

- name: Install Rust support for ARM64 & prepare environment
run: |
rustup target add aarch64-apple-darwin
Expand All @@ -51,17 +65,18 @@ jobs:
-output releases/spotty

- name: Upload artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: spotty-mac
path: releases/

Linux:
if: false
runs-on: ubuntu-20.04

steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v3

- name: Write Build Configuration File
uses: DamianReeves/write-file-action@v1.0
Expand All @@ -79,17 +94,62 @@ jobs:
docker run --rm -v $PWD/target:/build -v $PWD:/src spotty-cross

- name: Upload artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: spotty-linux
path: releases/

windows:
Linux_x86_64:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: ./.github/actions/xbuild-spotty
with:
binary-name: spotty-x86_64
client-id: ${{ env.KEYMASTER_CLIENT_ID }}
target-triple: x86_64-unknown-linux-musl

Linux_ARMv6:
if: false
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: ./.github/actions/xbuild-spotty
with:
binary-name: spotty-arm
client-id: ${{ env.KEYMASTER_CLIENT_ID }}
target-triple: arm-unknown-linux-musleabi

Linux_ARMv7:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: ./.github/actions/xbuild-spotty
with:
binary-name: spotty-hf
client-id: ${{ env.KEYMASTER_CLIENT_ID }}
target-triple: armv7-unknown-linux-musleabihf

Linux_ARMv8:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: ./.github/actions/xbuild-spotty
with:
binary-name: spotty-aarch64
client-id: ${{ env.KEYMASTER_CLIENT_ID }}
target-triple: aarch64-unknown-linux-musl

Windows:
runs-on: windows-2019

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Write Build Configuration File
uses: DamianReeves/write-file-action@v1.0
Expand All @@ -102,7 +162,7 @@ jobs:
run: cargo build --release

- name: Upload artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: spotty.exe
path: target/release/spotty.exe
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,4 @@ default = ["passthrough-decoder"]
[profile.release]
lto = true
panic = 'abort'
strip = true