Skip to content

Commit

Permalink
[ci] set up ci to be able to release binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
vmagro committed Jan 26, 2025
1 parent b282082 commit 66470f7
Show file tree
Hide file tree
Showing 7 changed files with 120 additions and 7 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/dotslash-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"outputs": {
"limelightctl": {
"platforms": {
"macos-aarch64": {
"regex": "^limelightctl-aarch64-apple-darwin.zst$",
"path": "limelightctl"
},
"linux-x86_64": {
"regex": "^limelightctl-x86_64-unknown-linux-gnu.zst$",
"path": "limelightctl"
},
"windows-x86_64": {
"regex": "^limelightctl-x86_64-pc-windows-gnu.exe.zst$",
"path": "limelightctl.exe"
}
}
}
}
}
26 changes: 26 additions & 0 deletions .github/workflows/dotslash.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: DotSlash

on:
workflow_run:
workflows: [release]
types:
- completed

jobs:
generate-dotslash-files:
name: Generating and uploading DotSlash files
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: facebook/dotslash-publish-release@v1
# This is necessary because the action uses
# `gh release upload` to publish the generated DotSlash file(s)
# as part of the release.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# Additional file that lives in your repo that defines
# how your DotSlash file(s) should be generated.
config: .github/workflows/dotslash-config.json
# Tag for the release to to target.
tag: ${{ github.event.workflow_run.head_branch }}
60 changes: 60 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Release

on:
push:
tags:
- "v*.*.*"

jobs:
release-build-linux-windows:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: sudo apt-get install -y gcc-mingw-w64
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin, x86_64-apple-darwin, x86_64-unknown-linux-gnu, x86_64-pc-windows-gnu
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --release
--target x86_64-unknown-linux-gnu
--target x86_64-pc-windows-gnu
- name: Compress outputs
run: |
zstd -z target/x86_64-pc-windows-gnu/release/limelightctl.exe -o limelightctl-x86_64-pc-windows-gnu.exe.zst
zstd -z target/x86_64-unknown-linux-gnu/release/limelightctl -o limelightctl-x86_64-unknown-linux-gnu.zst
- uses: actions/upload-artifact@v4
with:
name: linux+windows
path: 'limelightctl-*'

release-build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --release
--target aarch64-apple-darwin
- name: Compress outputs
run: |
zstd -z target/aarch64-apple-darwin/release/limelightctl -o limelightctl-aarch64-apple-darwin.zst
- uses: actions/upload-artifact@v4
with:
name: macos-arm64
path: 'limelightctl-*'

release:
runs-on: ubuntu-latest
needs: [release-build-linux-windows, release-build-macos]
steps:
- uses: softprops/action-gh-release@v2
- uses: actions/download-artifact@v4
- uses: softprops/action-gh-release@v2
name: Create release
with:
files: '*/limelightctl-*'
13 changes: 10 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --verbose
- name: Run tests
Expand All @@ -26,14 +27,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- uses: Swatinem/rust-cache@v2
- name: Check formatting
run: cargo fmt --check

clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Check formatting
run: cargo clippy --all-targets --all-features
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "limelightctl"
version = "0.1.0"
edition = "2024"
version = "0.0.0"
edition = "2021"

[dependencies]
anyhow = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
edition = "2024"
edition = "2021"
group_imports = "StdExternalCrate"
imports_granularity = "Item"

0 comments on commit 66470f7

Please sign in to comment.