Skip to content

Commit

Permalink
github: add release action
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanvc committed May 22, 2024
1 parent 9dcdd46 commit 0122013
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Based on https://github.com/open-contracting/cardinal-rs/blob/792a6df7d78f8800a0f86cbf081cbad4781faf43/.github/workflows/release.yml
name: Release
on:
push:
tags:
- v*
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- env:
GH_TOKEN: ${{ github.token }}
run: gh release create ${{ github.ref_name }}
assets:
needs: release
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
# 32-bit (i686)
- build: linux-i686
os: ubuntu-latest
target: i686-unknown-linux-gnu
command: cross
- build: windows-i686
os: ubuntu-latest
target: i686-pc-windows-gnu
command: cross
# 64-bit (x86)
- build: linux-x86_64
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
command: cross
- build: macos-x86_64
os: macos-latest
target: x86_64-apple-darwin
command: cargo
- build: windows-x86_64
os: ubuntu-latest
target: x86_64-pc-windows-gnu
command: cross
# 64-bit (ARM)
- build: macos-arm64
os: macos-latest
target: aarch64-apple-darwin
command: cargo
- build: linux-arm64
os: ubuntu-latest
target: aarch64-unknown-linux-gnu
command: cross
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
targets: ${{ matrix.target }}
- run: cargo install cross --git https://github.com/cross-rs/cross
- run: ${{ matrix.command }} build --release --target ${{ matrix.target }}
- id: rename
shell: bash
run: |
if [[ "${{ matrix.target }}" =~ "-pc-windows-" ]]; then
SUFFIX=.exe
fi
OUTPUT="marker-${{ matrix.build }}$SUFFIX"
mv "target/${{ matrix.target }}/release/marker$SUFFIX" "$OUTPUT"
echo "path=$OUTPUT" >> $GITHUB_OUTPUT
- env:
GH_TOKEN: ${{ github.token }}
run: gh release upload ${{ github.ref_name }} ${{ steps.rename.outputs.path }}

0 comments on commit 0122013

Please sign in to comment.