Skip to content

Commit

Permalink
update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
BigBoot committed Jan 13, 2024
1 parent 1c8ca09 commit 69ed174
Showing 1 changed file with 37 additions and 9 deletions.
46 changes: 37 additions & 9 deletions .github/workflows/rust-build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,16 @@ on:

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

strategy:
matrix:
os: [windows-latest, ubuntu-latest]
- runs-on: windows-latest
os: windown
- runs-on: ubuntu-latest
os: linux
- runs-on: macos-latest
os: mac

steps:
- name: Checkout code
Expand All @@ -27,18 +32,33 @@ jobs:
- name: Build
run: cargo build --release

- name: Test
run: cargo test
- shell: bash
run: |-
for file in autokuma autokuma.exe kuma kuma.exe; do
if [[ ! -e "target/release/$file" ]]; then
continue
fi
filename=$(basename "$file")
if [[ "$filename" == *.* ]]; then
extension=".${filename##*.}"
filename="${filename%.*}"
else
extension=""
fi
mkdir dist
mv "target/release/${filename}${extension}" "dist/${filename}-${{ matrix.os }}${extension}"
done
- name: Archive artifacts
uses: actions/upload-artifact@v4
with:
name: autokuma-${{ matrix.os }}
path: |
target/release/autokuma
target/release/autokuma.exe
target/release/kuma
target/release/kuma.exe
path: dist/*

release:
needs: [build]
Expand All @@ -55,10 +75,18 @@ jobs:
id: changelog
uses: coditory/changelog-parser@v1

- name: Download All Artifacts
uses: actions/download-artifact@v4
with:
path: autokuma
pattern: autokuma-*
merge-multiple: true

- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: Release ${{ github.ref }}
body: ${{ steps.changelog.outputs.description }}
files: autokuma/*

0 comments on commit 69ed174

Please sign in to comment.