55 lines
1.2 KiB
YAML
55 lines
1.2 KiB
YAML
name: Release app
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- v[0-9]+.*
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
CARGO_PROFILE_RELEASE_LTO: true
|
|
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 1
|
|
|
|
jobs:
|
|
check:
|
|
name: Check project
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Install Rust toolchain
|
|
run: rustup toolchain install stable --profile minimal --component clippy --component rustfmt
|
|
- uses: Swatinem/rust-cache@v2
|
|
- name: Format
|
|
run: cargo fmt --check
|
|
- name: Clippy
|
|
run: cargo clippy -- -W clippy::pedantic
|
|
|
|
create-release:
|
|
needs: check
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: taiki-e/create-gh-release-action@v1
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
upload-assets:
|
|
needs: create-release
|
|
strategy:
|
|
matrix:
|
|
os:
|
|
- ubuntu-latest
|
|
- macos-latest
|
|
- windows-latest
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: taiki-e/upload-rust-binary-action@v1
|
|
with:
|
|
bin: hoyolab-claim-bot
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|