Files
dredge/.github/workflows/release.yml
T
2023-09-28 17:45:11 -04:00

69 lines
1.9 KiB
YAML

name: Release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
jobs:
create_release:
name: Create release
runs-on: ubuntu-latest
permissions:
contents: write
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: ${{ github.ref }}
draft: false
prerelease: false
release_assets:
name: Release assets
needs: create_release
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
- os: ubuntu-latest
- os: macos-latest
- os: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust Toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Cache build dependencies
uses: Swatinem/rust-cache@v2
- name: Run cargo build
run: cargo build --release
- 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. Put hatever name
# you like, remember that they need to be different for each platform.
# You can choose any build matrix parameters. For Rust I use the
# target triple.
asset_name: dredge-${{ matrix.config.os }}
# The path to the file you want to upload.
asset_path: ./target/release/dredge
# probably you will need to change it, but most likely you are
# uploading a binary file
asset_content_type: application/octet-stream