diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..00d852a --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,75 @@ +name: Release Build + +on: + release: + types: [created] + +jobs: + release: + name: Release - ${{ matrix.release_for }} + permissions: + contents: write + strategy: + matrix: + include: + - release_for: Linux x86_64 + os: ubuntu-latest + target: x86_64-unknown-linux-gnu + bin: lowfi + name: lowfi-linux-x86_64 + command: build + + - release_for: Linux aarch64 + os: ubuntu-latest + target: aarch64-unknown-linux-gnu + bin: lowfi + name: lowfi-linux-aarch64 + command: build + + - release_for: Windows x86_64 + os: windows-latest + target: x86_64-pc-windows-msvc + bin: lowfi.exe + name: lowfi-windows-x86_64.exe + command: build + + - release_for: MacOS-x86_64 + os: macos-latest + target: x86_64-apple-darwin + bin: lowfi + name: lowfi-darwin-x86_64 + command: build + + - release_for: MacOS-aarch64 + os: macos-latest + target: aarch64-apple-darwin + bin: lowfi + name: lowfi-darwin-aarch64 + command: build + + runs-on: ${{ matrix.os }} + env: + GH_TOKEN: ${{ github.token }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: "true" + + - name: Build binary + uses: houseabsolute/actions-rust-cross@v0 + with: + command: ${{ matrix.command }} + target: ${{ matrix.target }} + args: "--locked --release" + + - name: Rename binary + run: | + cd ./target/${{ matrix.target }}/release + mv ${{ matrix.bin }} ${{ matrix.name }} + + - name: Upload binary to release + shell: bash + run: | + gh release upload ${{github.event.release.tag_name}} \ + ./target/${{ matrix.target }}/release/${{ matrix.name }} \