diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..374564e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,44 @@ +name: Release + +on: + push: + tags: + - 'v*' + +jobs: + build: + name: Build for ${{ matrix.name }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - name: linux + os: ubuntu-latest + - name: windows + os: windows-latest + bin_extension: .exe + - name: macos + os: macos-latest + + steps: + - uses: actions/checkout@v1 + + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.82.0 + + - name: Rust Cache + uses: Swatinem/rust-cache@v2.7.0 + + - name: Build + run: | + cargo build --release --locked --bins + mv ./target/release/spaday${{ matrix.bin_extension }} spaday-${{ matrix.name }}-${{ github.ref_name }}${{ matrix.bin_extension }} + env: + CARGO_PROFILE_RELEASE_LTO: "true" + + - name: Archive Artifacts + uses: softprops/action-gh-release@v2 + with: + files: | + spaday-${{ matrix.name }}-${{ github.ref_name }}${{ matrix.bin_extension }}