mirror of
https://github.com/xzeldon/razer-battery-report.git
synced 2024-12-25 19:05:47 +00:00
ci: setup github ci for releases
This commit is contained in:
parent
a418a73d3e
commit
66e6a5bbd5
58
.github/workflows/release.yml
vendored
Normal file
58
.github/workflows/release.yml
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
name: Build and Publish Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v[0-9]+.[0-9]+.[0-9]+"
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
- .github/workflows/build-and-release.yml
|
||||
- .gitignore
|
||||
- LICENSE
|
||||
- img/**
|
||||
|
||||
jobs:
|
||||
build-and-publish:
|
||||
name: Build and Publish Release
|
||||
permissions:
|
||||
contents: write
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@v4.1.0
|
||||
|
||||
- name: Setup workflow cache
|
||||
uses: actions/cache@v4.1.0
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/bin/
|
||||
~/.cargo/registry/index/
|
||||
~/.cargo/registry/cache/
|
||||
~/.cargo/git/db/
|
||||
target/
|
||||
key: windows-cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
|
||||
|
||||
- name: Setup Rust stable toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
target: x86_64-pc-windows-msvc
|
||||
|
||||
- name: Build
|
||||
run: cargo build --release --target x86_64-pc-windows-msvc
|
||||
|
||||
- name: Upload workflow artifact
|
||||
uses: actions/upload-artifact@v4.1.0
|
||||
with:
|
||||
name: razer-battery-report
|
||||
path: ./target/x86_64-pc-windows-msvc/release/razer-battery-report.exe
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Publish Release
|
||||
uses: softprops/action-gh-release@v2.1.0
|
||||
with:
|
||||
files: ./target/x86_64-pc-windows-msvc/release/razer-battery-report.exe
|
||||
draft: true
|
||||
fail_on_unmatched_files: true
|
Loading…
Reference in New Issue
Block a user