-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (79 loc) · 2.43 KB
/
main.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
95
96
97
98
name: main
on: [push, pull_request]
jobs:
test:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Run tests
run: >
dotnet test
--configuration Release
build:
needs: test
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Publish
run: >
dotnet publish NightGlow
-c Release
--output NightGlow/bin/publish/
- name: Create installer
shell: pwsh
run: |
choco install innosetup --no-progress
Copy-Item -Path NightGlow/bin/publish/ -Recurse -Destination Installer/Source/
& "c:\Program Files (x86)\Inno Setup 6\ISCC.exe" Installer/Installer.iss
- name: Upload artifacts (portable)
uses: actions/upload-artifact@v3
with:
name: NightGlow-Portable
path: NightGlow/bin/publish/
- name: Upload artifacts (installer)
uses: actions/upload-artifact@v3
with:
name: NightGlow-Installer
path: Installer/bin/NightGlow-Installer.exe
deploy:
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifacts (portable)
uses: actions/download-artifact@v3
with:
name: NightGlow-Portable
path: NightGlow
- name: Download artifacts (installer)
uses: actions/download-artifact@v3
with:
name: NightGlow-Installer
- name: Create package (portable)
shell: pwsh
run: >
Compress-Archive
-Path NightGlow
-DestinationPath NightGlow-Portable.zip
-Force
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: >
gh release create "${{ github.ref_name }}"
"NightGlow-Portable.zip"
"NightGlow-Installer.exe"
--repo "${{ github.event.repository.full_name }}"
--title "${{ github.ref_name }}"
--notes "[Changelog](${{ github.event.repository.html_url }}/blob/${{ github.ref_name }}/CHANGELOG.md)"
--verify-tag