From 25c26ee3eac8b79cf1dba421de4110e02cfd3102 Mon Sep 17 00:00:00 2001 From: Ralf Grubenmann Date: Mon, 11 Mar 2024 16:26:37 +0100 Subject: [PATCH] add release action --- .github/workflows/release.yml | 50 +++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..be88cc6 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,50 @@ +name: Release +on: + push: + tags: + - "v*" +jobs: + create_release: + name: Create release + runs-on: ubuntu-latest + # Note this. We are going to use that in further jobs. + outputs: + upload_url: ${{ steps.create_release.outputs.upload_url }} + steps: + - name: Create release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: true + prerelease: false + build: + name: Build + needs: create_release + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macOS-latest] + + steps: + - uses: actions/checkout@v4 + - name: Setup Rust + run: rustup toolchain add stable + - name: build + run: | + mkdir -p ./output + cargo build --release --target-dir ./output + - name: Upload release assets + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.create_release.outputs.upload_url }} + # This is how it will be named on the release page. + asset_name: avrodisiac-${{ matrix.os }} + # The path to the file you want to upload. + asset_path: ./output/avrodisiac + asset_content_type: application/octet-stream