-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (92 loc) · 2.88 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
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