Skip to content

Release

Release #101

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
version:
description: "App version"
required: true
type: string
prerelease:
description: "Is pre-release"
type: boolean
required: false
default: false
concurrency:
group: ${{ github.workflow }}-release
cancel-in-progress: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
platform: windows
steps:
- uses: actions/checkout@v5
- uses: taiki-e/install-action@just
if: matrix.platform == 'windows'
- name: Build lhm
run: just lhm
- name: Build
run: |
FAN_CONTROL_VERSION=${{ inputs.version }} just build
if: matrix.platform == 'windows'
- run: rustup update&
if: matrix.platform == 'windows'
- uses: Swatinem/rust-cache@v2
if: matrix.platform == 'windows'
- run: cargo install cargo-packager
if: matrix.platform == 'windows'
- name: Package nsis
run: just nsis
if: matrix.platform == 'windows'
- name: Upload windows build
uses: actions/upload-artifact@v5
with:
name: fan-control-windows
path: |
./target/release/fan-control*-setup.exe
release-on-github:
needs:
- build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
# must be after checkout because it will remove artifacts
- uses: actions/download-artifact@v6
with:
merge-multiple: true
path: all-artifacts
- name: Set prerelease flag
if: ${{ github.event.inputs.prerelease == 'true' }}
run: |
echo "PRERELEASE=--prerelease" >> $GITHUB_ENV
- name: Publish release
run: |
# delete tag/release if needed
gh release delete nightly --yes || true
git push --delete origin nightly || true
gh release delete ${{ inputs.version }} --yes || true
git push --delete origin ${{ inputs.version }} || true
git tag ${{ inputs.version }}
git push origin --tags
# https://cli.github.com/manual/gh_release_create
gh release create ${{ inputs.version }} --title "${{ inputs.version }}" \
--verify-tag ${{ env.PRERELEASE }} --generate-notes --target $GITHUB_SHA \
all-artifacts/**/*