fix update and relative config path #44
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create release on push | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- "**.cs" | |
- "**.xaml" | |
- "**.csproj" | |
- "**.sln" | |
- "**.pubxml" | |
- "**.yml" | |
- "**.targets" | |
- "**.props" | |
- "**/Resources/**.*" | |
workflow_dispatch: | |
inputs: | |
doNotRelease: | |
description: 'Force run and do not release' | |
required: false | |
type: boolean | |
jobs: | |
should-release: | |
name: Should Release | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.get-version.outputs.version }} | |
tag: ${{ steps.get-tag.outputs.tag }} | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Get Previous tag | |
id: get-tag | |
uses: WyriHaximus/github-action-get-previous-tag@v1 | |
- name: Get version | |
id: get-version | |
run: node ./.github/workflows/get-version.js | |
release: | |
name: Release | |
runs-on: windows-2022 | |
needs: should-release | |
if: needs.should-release.outputs.version != needs.should-release.outputs.tag || github.event.inputs.doNotRelease | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
- name: Download HSDeckTracker | |
uses: robinraju/[email protected] | |
with: | |
fileName: HDT-Installer.exe | |
latest: true | |
repository: HearthSim/HDT-Releases | |
tarBall: false | |
zipBall: false | |
- name: Cache HSDeckTracker | |
id: cache-hdt | |
uses: actions/cache@v3 | |
with: | |
path: ~\AppData\Local\HearthstoneDeckTracker | |
key: ${{ runner.os }}-hdt-${{ hashFiles('HDT-Installer.exe') }} | |
- name: Setup Hearthstone Deck Tracker | |
if: steps.cache-hdt.outputs.cache-hit != 'true' | |
run: HDT-Installer.exe | |
shell: cmd | |
- name: Setup MSBuild | |
uses: microsoft/[email protected] | |
with: | |
msbuild-architecture: x64 | |
- name: Build solution | |
run: msbuild HearthstoneQuestOverlay.sln -m -t:restore,build -p:RestorePackagesConfig=true -p:Configuration=Release | |
- name: Zip release | |
run: cd QuestOverlayPlugin/bin && 7z a -tzip ..\..\HearthstoneQuestOverlay HearthstoneQuestOverlay | |
shell: cmd | |
- name: Create Release | |
if: ${{ !github.event.inputs.doNotRelease }} | |
uses: ncipollo/release-action@v1 | |
with: | |
allowUpdates: false | |
name: Release ${{ needs.should-release.outputs.version }} | |
draft: false | |
prerelease: false | |
token: ${{ secrets.GITHUB_TOKEN }} | |
artifacts: './HearthstoneQuestOverlay.zip' | |
tag: ${{ needs.should-release.outputs.version }} | |
- name: Create Artifact | |
if: github.event.inputs.doNotRelease | |
uses: actions/upload-artifact@v3 | |
with: | |
name: HearthstoneQuestOverlay | |
path: HearthstoneQuestOverlay.zip | |
retention-days: 1 |