Skip to content

Commit

Permalink
ci: rewrite new release-cli ci
Browse files Browse the repository at this point in the history
  • Loading branch information
SARDONYX-sard committed Oct 7, 2023
1 parent ccdd4e5 commit 99d0b53
Showing 1 changed file with 46 additions and 18 deletions.
64 changes: 46 additions & 18 deletions .github/workflows/release-cli.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,57 @@
name: Release Cli

on:
push:
tags:
- "*"
workflow_dispatch:

jobs:
release:
name: release ${{ matrix.target }}
runs-on: ubuntu-latest
build:
name: Release binary
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
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
artifact_name: dar2oar
asset_name: dar2oar-x86_64-unknown-linux-gnu
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
artifact_name: dar2oar
asset_name: dar2oar-x86_64-unknown-linux-musl
- os: ubuntu-latest
target: x86_64-pc-windows-gnu
artifact_name: dar2oar.exe
asset_name: dar2oar-x86_64-pc-windows-gnu.exe
- os: macos-latest
target: x86_64-apple-darwin
artifact_name: dar2oar
asset_name: dar2oar-x86_64-apple-darwin

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@master
- name: Compile and release
uses: rust-build/rust-build.action@v1.4.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout repository
uses: actions/checkout@v3

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Cross build with all features
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --target ${{ matrix.target }} --all-features --verbose

- name: Upload binaries to release
uses: svenstaro/upload-release-action@2.1.1
with:
RUSTTARGET: ${{ matrix.target }}
ARCHIVE_TYPES: ${{ matrix.archive }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
asset_name: ${{ matrix.asset_name }}
tag: ${{ github.ref }}
overwrite: true

0 comments on commit 99d0b53

Please sign in to comment.