updated release github actions

This commit is contained in:
sreedev
2023-01-23 02:28:57 -05:00
parent 4a18b3fd91
commit 02f70aa55f
2 changed files with 30 additions and 44 deletions

View File

@@ -1,44 +0,0 @@
name: Build and release
on:
push:
branches:
- main
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Build for Windows
run: |
cargo build --release --target x86_64-pc-windows-gnu
- name: Build for Linux
run: |
cargo build --release --target x86_64-unknown-linux-gnu
- name: Build for MacOS
run: |
cargo build --release --target x86_64-apple-darwin
- name: Create release
uses: actions/create-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

30
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,30 @@
name: Release
on:
push:
branches: [main]
release:
types: [created]
jobs:
release:
name: release ${{ matrix.target }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-pc-windows-gnu
archive: zip
- target: x86_64-unknown-linux-musl
archive: tar.gz tar.xz tar.zst
- target: x86_64-apple-darwin
archive: zip
steps:
- uses: actions/checkout@master
- name: Compile and release
uses: rust-build/rust-build.action@v1.4.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
RUSTTARGET: ${{ matrix.target }}
ARCHIVE_TYPES: ${{ matrix.archive }}