-
Notifications
You must be signed in to change notification settings - Fork 276
103 lines (92 loc) · 3.1 KB
/
Lagrange.OneBot-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
name: Lagrange.OneBot Release
on:
workflow_dispatch:
jobs:
Build:
runs-on: windows-latest
strategy:
matrix:
runtimeIdentifier:
[
win-x64,
win-x86,
linux-x64,
linux-arm,
linux-arm64,
osx-x64,
osx-arm64,
linux-musl-x64,
linux-musl-arm,
linux-musl-arm64,
]
steps:
- uses: actions/checkout@v4
- name: Install .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Build Lagrange.OneBot .NET 8.0
shell: powershell
run: |
dotnet publish Lagrange.OneBot/Lagrange.OneBot.csproj --self-contained -p:PublishSingleFile=true -p:IncludeContentInSingleFile=true -p:RuntimeIdentifier=${{ matrix.runtimeIdentifier }} --framework net8.0
- name: Upload binary files(${{ matrix.runtimeIdentifier }}) for .NET 8.0
uses: actions/upload-artifact@v3
with:
name: Lagrange.OneBot_${{ matrix.runtimeIdentifier }}_8.0
path: Lagrange.OneBot/bin/Release/net8.0/${{ matrix.runtimeIdentifier }}/publish
- name: Compress files (Not Windows)
if: matrix.runtimeIdentifier != 'win-x64' && matrix.runtimeIdentifier != 'win-x86'
run: |
Compress-Archive -Path 'Lagrange.OneBot\bin\Release\net8.0\${{ matrix.runtimeIdentifier }}\publish\Lagrange.OneBot' -DestinationPath 'Lagrange.OneBot_${{ matrix.runtimeIdentifier }}_8.0.zip'
- name: Compress files (Windows)
if: matrix.runtimeIdentifier == 'win-x64' || matrix.runtimeIdentifier == 'win-x86'
run: |
Compress-Archive -Path 'Lagrange.OneBot\bin\Release\net8.0\${{ matrix.runtimeIdentifier }}\publish\Lagrange.OneBot.exe' -DestinationPath 'Lagrange.OneBot_${{ matrix.runtimeIdentifier }}_8.0.zip'
- name: Prepare release files
uses: actions/upload-artifact@v3
with:
name: Lagrange.OneBot_all
path: Lagrange.OneBot_${{ matrix.runtimeIdentifier }}_8.0.zip
NightlyRelease:
name: Nightly Release
runs-on: ubuntu-latest
needs: Build
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Update Nightly Tag
run: |
git tag -f nightly
git push -f origin nightly
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: Lagrange.OneBot_all
path: ./bin
- name: Update Nightly Release
uses: ncipollo/release-action@v1
with:
tag: nightly
name: "Nightly Release"
prerelease: true
body: "> ⚠️This is a nightly release."
artifacts: |
./bin/*
allowUpdates: true
removeArtifacts: true
ClearTempArtifacts:
name: Clear Temp Artifacts
if: always()
runs-on: ubuntu-latest
needs:
- NightlyRelease
permissions:
actions: write
steps:
- uses: geekyeggo/delete-artifact@v2
with:
name: |
Lagrange.OneBot_all