-
-
Notifications
You must be signed in to change notification settings - Fork 52
140 lines (136 loc) · 5.81 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: Sidekick Release
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
env:
ASPNETCORE_ENVIRONMENT: Production
steps:
- name: Git - Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: GitVersion - Install
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'
- name: GitVersion - Execute
id: gitversion
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true
additionalArguments: '/updateprojectfiles'
- name: GitVersion - Output
run: |
echo "Major: ${{ steps.gitversion.outputs.major }}"
echo "Minor: ${{ steps.gitversion.outputs.minor }}"
echo "Patch: ${{ steps.gitversion.outputs.patch }}"
echo "PreReleaseTag: ${{ steps.gitversion.outputs.preReleaseTag }}"
echo "PreReleaseTagWithDash: ${{ steps.gitversion.outputs.preReleaseTagWithDash }}"
echo "PreReleaseLabel: ${{ steps.gitversion.outputs.preReleaseLabel }}"
echo "PreReleaseNumber: ${{ steps.gitversion.outputs.preReleaseNumber }}"
echo "WeightedPreReleaseNumber: ${{ steps.gitversion.outputs.weightedPreReleaseNumber }}"
echo "BuildMetaData: ${{ steps.gitversion.outputs.buildMetaData }}"
echo "BuildMetaDataPadded: ${{ steps.gitversion.outputs.buildMetaDataPadded }}"
echo "FullBuildMetaData: ${{ steps.gitversion.outputs.fullBuildMetaData }}"
echo "MajorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }}"
echo "SemVer: ${{ steps.gitversion.outputs.semVer }}"
echo "LegacySemVer: ${{ steps.gitversion.outputs.legacySemVer }}"
echo "LegacySemVerPadded: ${{ steps.gitversion.outputs.legacySemVerPadded }}"
echo "AssemblySemVer: ${{ steps.gitversion.outputs.assemblySemVer }}"
echo "AssemblySemFileVer: ${{ steps.gitversion.outputs.assemblySemFileVer }}"
echo "FullSemVer: ${{ steps.gitversion.outputs.fullSemVer }}"
echo "InformationalVersion: ${{ steps.gitversion.outputs.informationalVersion }}"
echo "BranchName: ${{ steps.gitversion.outputs.branchName }}"
echo "EscapedBranchName: ${{ steps.gitversion.outputs.escapedBranchName }}"
echo "Sha: ${{ steps.gitversion.outputs.sha }}"
echo "ShortSha: ${{ steps.gitversion.outputs.shortSha }}"
echo "NuGetVersionV2: ${{ steps.gitversion.outputs.nuGetVersionV2 }}"
echo "NuGetVersion: ${{ steps.gitversion.outputs.nuGetVersion }}"
echo "NuGetPreReleaseTagV2: ${{ steps.gitversion.outputs.nuGetPreReleaseTagV2 }}"
echo "NuGetPreReleaseTag: ${{ steps.gitversion.outputs.nuGetPreReleaseTag }}"
echo "VersionSourceSha: ${{ steps.gitversion.outputs.versionSourceSha }}"
echo "CommitsSinceVersionSource: ${{ steps.gitversion.outputs.commitsSinceVersionSource }}"
echo "CommitsSinceVersionSourcePadded: ${{ steps.gitversion.outputs.commitsSinceVersionSourcePadded }}"
echo "UncommittedChanges: ${{ steps.gitversion.outputs.uncommittedChanges }}"
echo "CommitDate: ${{ steps.gitversion.outputs.commitDate }}"
- name: Environment - Build Number
uses: myci-actions/export-env-var@1
with:
name: BUILD_NUMBER
value: ${{ steps.gitversion.outputs.fullSemVer }}
- name: Environment - Github Token
uses: myci-actions/export-env-var@1
with:
name: GITHUB_TOKEN
value: ${{ github.token }}
- name: .NET - Setup
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: NuGet - Setup
uses: NuGet/[email protected]
- name: NuGet - Source
uses: fabriciomurta/ensure-nuget-source@v1
- name: .NET - Restore
run: dotnet restore
- name: .NET - Build
run: dotnet build --no-restore
- name: .NET - Tool Restore
run: |
cd ./src/Sidekick.Presentation.Blazor.Electron
dotnet tool restore
- name: Electron - Build
run: |
cd ./src/Sidekick.Presentation.Blazor.Electron
dotnet electronize build /target win /PublishSingleFile false
- name: Artifact - Build
uses: actions/[email protected]
with:
name: Sidekick-windows
path: ./src/Sidekick.Presentation.Blazor.Electron/bin/Desktop/Sidekick-Setup.exe
# Manual release
- name: Manual Release - Notes
if: github.ref != 'refs/heads/main'
uses: release-drafter/[email protected]
with:
name: 'Release v${{ steps.gitversion.outputs.fullSemVer }}'
tag: v${{ steps.gitversion.outputs.fullSemVer }}
version: v${{ steps.gitversion.outputs.fullSemVer }}
publish: false
prerelease: true
- name: Manual Release - Asset
if: github.ref != 'refs/heads/main'
uses: xresloader/[email protected]
with:
file: src/Sidekick.Presentation.Blazor.Electron/bin/Desktop/Sidekick-Setup.exe
tag_name: v${{ steps.gitversion.outputs.fullSemVer }}
draft: true
verbose: true
overwrite: true
# Main release
- name: Main Release - Notes
if: github.ref == 'refs/heads/main'
uses: release-drafter/[email protected]
with:
name: 'Release v${{ steps.gitversion.outputs.majorMinorPatch }}'
tag: v${{ steps.gitversion.outputs.majorMinorPatch }}
version: v${{ steps.gitversion.outputs.majorMinorPatch }}
publish: false
prerelease: false
- name: Main Release - Asset
if: github.ref == 'refs/heads/main'
uses: xresloader/[email protected]
with:
file: src/Sidekick.Presentation.Blazor.Electron/bin/Desktop/Sidekick-Setup.exe
tag_name: v${{ steps.gitversion.outputs.majorMinorPatch }}
draft: true
verbose: true
overwrite: true