-
Notifications
You must be signed in to change notification settings - Fork 1
90 lines (79 loc) · 2.88 KB
/
build-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
name: Build Release
on:
workflow_dispatch:
push:
tags:
- 'Release*'
permissions:
contents: write
jobs:
Build:
name: Release SrcGit
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get Tag
id: var
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
# Install the .NET Core workload
- name: Install .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
- name: Setup MSBuild
uses: microsoft/[email protected]
- name: Build no-self-contained
run: |
dotnet publish src/SrcGit.csproj --nologo -c Release -r win-x64 -f net6.0-windows -p:PublishSingleFile=true --no-self-contained -o publish
- name: Build self-contained
run: |
dotnet publish src/SrcGit.csproj --nologo -c Release -r win-x64 -f net6.0-windows -p:PublishSingleFile=true -p:EnableCompressionInSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:PublishReadyToRun=true --self-contained -o publish/tmp
move publish/tmp/SrcGit.exe publish/SrcGit.bundle.exe
Remove-Item publish\\tmp -recurse
# https://github.com/marketplace/actions/upload-a-build-artifact
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: SrcGit
path: publish
# https://github.com/marketplace/actions/auto-changelog
# require commit format are "type(category): description [flag]"
- name: Make Changelog
uses: ardalanamini/auto-changelog@v4
id: changelog
with:
github-token: ${{ github.token }}
commit-types: |
breaking: Breaking Changes
feat: New Features
fix: Bug Fixes
revert: Reverts
perf: Performance Improvements
refactor: Refactors
deps: Dependencies
docs: Documentation Changes
style: Code Style Changes
build: Build System
ci: Continuous Integration
test: Tests
chore: Chores
other: Other Changes
default-commit-type: Other Changes
mention-authors: false
mention-new-contributors: true
include-compare: false
semver: false
# https://github.com/marketplace/actions/gh-release
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
token: ${{ github.token }}
body: ${{ steps.changelog.outputs.changelog }}
prerelease: false
files: |
publish\SrcGit.bundle.exe
publish\SrcGit.exe