Skip to content

try to match in more situations #11

try to match in more situations

try to match in more situations #11

Workflow file for this run

name: Build danmaku
on:
workflow_dispatch:
push:
tags:
- v*
branches:
- main
paths-ignore:
- "*.md"
- "LICENSE"
- ".gitignore"
- ".github/**"
jobs:
build-release:
env:
RUST_BACKTRACE: full
strategy:
matrix:
include:
- arch: x86_64-windows-gnu
os: windows-latest
artifact: danmaku.dll
- arch: x86_64-linux-gnu
os: ubuntu-latest
artifact: danmaku.so
runs-on: ${{matrix.os}}
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Build danmaku-${{ matrix.arch }}
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
cargo b -r
cp target/release/libdanmaku.so danmaku.so
mv target/release/libdanmaku.so target/release/danmaku.so
tar -czf danmaku-${{ matrix.arch }}.tar.gz danmaku.so
- name: Build danmaku-${{matrix.arch}}
if: ${{ matrix.os == 'windows-latest' }}
run: |
cargo b -r
cp target/release/danmaku.dll danmaku.dll
7z a danmaku-${{ matrix.arch }}.7z danmaku.dll
- name: Upload
uses: actions/upload-artifact@v4
with:
name: danmaku-${{ matrix.arch }}
path: target/release/${{ matrix.artifact }}
- name: Get latest tag name
if: ${{ startsWith(github.ref, 'refs/tags/') }}
id: tag
run: echo "TAG_NAME=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT
- name: Release
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
*.7z
*.tar.gz
tag_name: ${{ steps.tag.outputs.TAG_NAME }}