This repository has been archived by the owner on Sep 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
107 lines (89 loc) · 3 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
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Publish Release
on:
push:
branches:
- master
jobs:
# Build and release
build:
runs-on: windows-latest
steps:
# Checkout the repository
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
# Fetch latest tag
- name: Get tag
id: get-tag
run: |
echo "::set-output name=TAG::$(git describe --match "[0-9].[0-9].[0-9].[0-9]" --tags --abbrev=0)"
# Install the .NET Core workload
- name: Install .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.100
# Nuget
- name: Restore NuGet packages
uses: nuget/setup-nuget@v1
with:
nuget-version: '5.x'
- run: nuget restore Spcode.sln
# Setup MSBuild
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1.1
# Build SPCode
- name: Build SPCode
run: msbuild Spcode.csproj /p:Configuration=Release /p:langversion=latest
# Build Installer
- name: Build Installer (NSIS)
uses: joncloud/makensis-action@v1
with:
script-file: .\bin\Release\SPCode.nsi
# Compress Portable Version
- name: Compress Portable Version
run: .\bin\Release\Compress.ps1
shell: powershell
# Build Updater
- name: Build Updater
run: msbuild Deploy\SPCodeUpdater\SPCodeUpdater.csproj /p:Configuration=Release /property:langversion=latest
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get-tag.outputs.TAG }}
release_name: Release ${{ steps.get-tag.outputs.TAG }}
draft: false
prerelease: false
- name: Upload Installer
id: upload-installer
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: .\bin\Release\SPCode.Installer.exe
asset_name: SPCode.Installer.exe
asset_content_type: application/octet-stream
- name: Upload Portable
id: upload-portable
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: .\bin\Release\SPCode.Portable.zip
asset_name: SPCode.Portable.zip
asset_content_type: application/zip
- name: Upload Updater
id: upload-updater
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: .\Deploy\SpcodeUpdater\bin\Release\SPCodeUpdater.exe
asset_name: SPCodeUpdater.exe
asset_content_type: application/octet-stream