mirror of
https://github.com/anthonyoteri/dredge.git
synced 2026-06-05 15:26:53 -04:00
Create release workflow
This commit is contained in:
@@ -0,0 +1,66 @@
|
|||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "v[0-9]+.[0-9]+.[0-9]+*"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
create_release:
|
||||||
|
name: Create release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
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
|
||||||
Reference in New Issue
Block a user