Skip to content

Commit

Permalink
improve gha to parallelise building for multiple platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
BlockListed committed Mar 19, 2024
1 parent 4fc19e3 commit 13a416b
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 32 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build Release
on:
push:
tags: ["*"]
branches: ["*"]

jobs:
build:
runs-on: ubuntu-latest
env:
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: "sparse"
strategy:
matrix:
target: ["x86_64-unknown-linux-musl", "aarch64-unknown-linux-musl"]
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- uses: dtolnay/rust-toolchain@stable
- name: Install cross
run: |
cargo install cross --git https://github.com/cross-rs/cross
- name: Build project ${{ matrix.target }}
run: |
cross build --release --target ${{ matrix.target }}
- name: Upload build result
uses: actions/upload-artifact@v4
with:
path: target/release/${{ matrix.target }}/modrinth-downloader
name: modrinth-downloader-${{ matrix.target }}

release:
runs-on: ubuntu-latest
needs: build

permissions:
contents: write
steps:
- name: Download build results
uses: actions/download-artifact@v4
- uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
modrinth-downloader-*
32 changes: 0 additions & 32 deletions .github/workflows/release.yml

This file was deleted.

0 comments on commit 13a416b

Please sign in to comment.