-
Notifications
You must be signed in to change notification settings - Fork 3
53 lines (41 loc) · 1.4 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
name: Release
on:
push:
tags: ["*"]
jobs:
build:
runs-on: windows-latest
outputs:
artifact-id: ${{ steps.upload-artifact.outputs.artifact-id }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Set version
id: set-version
uses: actions/github-script@v7
with:
script: return context.ref.split("/")[2]
result-encoding: string
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Publish
run: dotnet publish -p:PublishSingleFile=true -p:Version=${{ steps.set-version.outputs.result }} -r win-x64 -c Release --no-self-contained
- name: Upload artifact
id: upload-artifact
uses: actions/upload-artifact@v4
with:
name: Data-Package-Tool-v${{ steps.set-version.outputs.result }}-${{ github.sha }}
path: .\src\bin\Release\net6.0-windows\win-x64\publish\*
- name: Create release
uses: softprops/action-gh-release@v2
with:
draft: true
files: ./src/bin/Release/net6.0-windows/win-x64/publish/Data-Package-Tool.exe
name: Data Package Tool v${{ steps.set-version.outputs.result }}
token: ${{ secrets.ACCESS_TOKEN }}