-
-
Notifications
You must be signed in to change notification settings - Fork 32
53 lines (42 loc) · 1.42 KB
/
publish.yml
File metadata and controls
53 lines (42 loc) · 1.42 KB
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: "Publish"
on:
push:
tags:
- "v*"
env:
PROJECT_PATH: src/HandyWinget/HandyWinget.csproj
ZIP_PATH: src/HandyWinget/bin/Release/net5.0-windows/win-x86/publish/HandyWinget-Portable.zip
EXE_PATH: src/HandyWinget/bin/Release/net5.0-windows/win-x86/publish/HandyWinget.exe
jobs:
deploy:
runs-on: windows-latest
steps:
- name: Initialize Actions
uses: actions/checkout@v2
- name: Initialize .Net
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: Restore Project
run: dotnet restore ${{ env.PROJECT_PATH }}
- name: Publish Project
run: dotnet publish ${{ env.PROJECT_PATH }} -c Release --self-contained -r win-x86 --no-restore
- name: Create Zip File
uses: papeloto/action-zip@v1
with:
files: ${{ env.EXE_PATH }}
dest: ${{ env.ZIP_PATH }}
- name: Initialize Release
uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
- name: Create Release
uses: csexton/release-asset-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.ZIP_PATH }}
release-url: ${{ steps.create_release.outputs.upload_url }}