diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..06d10905 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,40 @@ +name: Build Example +on: + workflow_dispatch: {} + +env: + binary: shrs_example + +jobs: + release_linux: + runs-on: ubuntu-latest + steps: + - uses: little-core-labs/get-git-tag@v3.0.1 + id: get_version + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: x86_64-unknown-linux-gnu + override: true + - name: Build + run: | + cargo build --release --target x86_64-unknown-linux-gnu + - name: Prepare package + run: | + mkdir linux + cp target/x86_64-unknown-linux-gnu/release/shrs_example linux/ + chmod +x linux/shrs_example + - name: Package as a zip + uses: vimtor/action-zip@v1 + with: + files: linux + dest: ${{ env.binary }}.zip + - name: Upload binaries to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ${{ env.binary }}.zip + asset_name: ${{ env.binary }}-linux-${{ github.ref }}.zip + tag: ${{ github.ref }} + overwrite: true diff --git a/justfile b/justfile index 37b3b623..e2f30d39 100644 --- a/justfile +++ b/justfile @@ -4,6 +4,9 @@ default: debug debug: cargo +nightly run shrs_example +build: + cargo build --release --target x86_64-unknown-linux-gnu + install: cargo install --profile=release --path shrs_example