Skip to content

Commit

Permalink
Update release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
crnvl committed Jul 16, 2023
1 parent 59b0174 commit f1b4464
Showing 1 changed file with 19 additions and 78 deletions.
97 changes: 19 additions & 78 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,88 +1,29 @@
name: Rust

on:
workflow_run:
workflows: ["Check Build"]
types:
- completed
release:
types: [created]

jobs:
build:
release:
name: release ${{ matrix.target }}
runs-on: ubuntu-latest

if: ${{ github.event.workflow_run.conclusion == 'success' }}

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:
- name: Checkout
uses: actions/checkout@v1

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

- name: Build
run: cargo build --all --release && strip target/release/netl2 && mv target/release/netl2 target/release/netl2_amd64

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
target/release/netl2_amd64
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-win:
runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v1

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

- name: Build
run: cargo build --all --release

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: target/release/netl2.exe
- uses: actions/checkout@master
- name: Compile and release
uses: rust-build/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-mac:
runs-on: macos-latest

steps:
- name: Checkout
uses: actions/checkout@v1

- name: Install latest rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: x86_64-apple-darwin
default: true
override: true

- name: Build for mac
run: cargo build --all --release && strip target/release/netl2 && mv target/release/netl2 target/release/netl2_darwin

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
target/release/netl2_darwin
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RUSTTARGET: ${{ matrix.target }}
ARCHIVE_TYPES: ${{ matrix.archive }}

0 comments on commit f1b4464

Please sign in to comment.