summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJovansonlee Cesar <ivanceras@gmail.com>2021-07-23 21:52:37 +0800
committerGitHub <noreply@github.com>2021-07-23 21:52:37 +0800
commitf492d0e2795a0aab2a15a84a2e81cbfd36967bb5 (patch)
tree7f6624273fbb3cdc13e5b972e90570f11e81a3ee
parent6193986520c55018f1aff0d0a3a5689f5598ef9b (diff)
parented1c3fa4a440fb13733d0f2599e5e85333aa5b73 (diff)
Merge pull request #76 from mbarkhau/master
Add GH action to build binaries
-rw-r--r--.github/workflows/release.yml60
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}}