diff options
author | Manuel Barkhau <mbarkhau@gmail.com> | 2021-07-22 14:39:01 +0000 |
---|---|---|
committer | Manuel Barkhau <mbarkhau@gmail.com> | 2021-07-22 14:48:44 +0000 |
commit | ed1c3fa4a440fb13733d0f2599e5e85333aa5b73 (patch) | |
tree | 7f6624273fbb3cdc13e5b972e90570f11e81a3ee | |
parent | 6193986520c55018f1aff0d0a3a5689f5598ef9b (diff) |
add gh action to build binaries
-rw-r--r-- | .github/workflows/release.yml | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ddf8e86 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,60 @@ +name: "Build" + +on: [push] + +# on: +# release: +# types: [created] + +jobs: + build: + runs-on: '${{ matrix.os }}' + name: "Build ${{ matrix.target }}" + strategy: + max-parallel: 2 + matrix: + include: + - os: ubuntu-latest + target: x86_64-unknown-linux-gnu + suffix: "" + - os: windows-latest + target: x86_64-pc-windows-msvc + suffix: ".exe" + # - os: macos-latest + # target: x86_64-apple-darwin + # suffix: "" + + steps: + - uses: actions/checkout@master + + - uses: actions/cache@v1 + with: + path: ~/.cargo/registry + key: '${{ runner.os }}-cargo-registry-${{ hashFiles(''**/Cargo.lock'') }}' + - uses: actions/cache@v1 + with: + path: ~/.cargo/git + key: '${{ runner.os }}-cargo-index-${{ hashFiles(''**/Cargo.lock'') }}' + - uses: actions/cache@v1 + with: + path: target + key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} + + - name: Install nightly + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + override: true + target: ${{ matrix.target }} + + - name: Run cargo build --release + uses: actions-rs/cargo@v1 + with: + command: build + args: --release + + - name: Archive Binaries + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.target }} + path: ./target/release/svgbob${{ matrix.suffix}} |