-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (48 loc) · 1.41 KB
/
release.yml
File metadata and controls
59 lines (48 loc) · 1.41 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
54
55
56
57
58
59
name: Build & Release .NET App
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v5
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10'
- name: Publish
run: dotnet msbuild BangumiNet -restore -p:Configuration=Release -p:Version=${GITHUB_REF_NAME#v} -t:PublishAllRuntimes
- name: Archive
shell: bash
run: |
for i in BangumiNet/bin/Release/net10.0/*/publish/; do
(
cd $i || exit
zip -r "../../../../../../${{ github.event.repository.name }}-${{ github.ref_name }}-${i:31:(${#i}-31-9)}.zip" .
)
done
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: app-archive
path: ${{ github.event.repository.name }}-${{ github.ref_name }}-*.zip
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v5
with:
name: app-archive
path: .
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: ${{ github.event.repository.name }}-${{ github.ref_name }}-*.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}