-
Notifications
You must be signed in to change notification settings - Fork 8
90 lines (77 loc) · 2.37 KB
/
Copy pathdevelop_push.yml
File metadata and controls
90 lines (77 loc) · 2.37 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
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: 验证代码
on:
workflow_dispatch:
push:
branches: ["2.0-develop"]
permissions:
contents: write
jobs:
# 1. 生成版本号
version:
runs-on: ubuntu-latest
outputs:
v: ${{ steps.version.outputs.value }}
tag: ${{ steps.version.outputs.tag }}
time: ${{ steps.time.outputs.value }}
steps:
- name: Generate version
id: version
run: |
VERSION=$(date +'%Y.%m.%d.%H%M')
echo "value=$VERSION" >> $GITHUB_OUTPUT
echo "tag=v$VERSION" >> $GITHUB_OUTPUT
- name: Get current time
id: time
run: |
echo "value=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_OUTPUT
# 2. Windows 构建任务
win-build:
runs-on: windows-latest
needs: version
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x
- name: Build Windows
run: |
cd ./src/BedrockBoot
dotnet publish -c Release -r win-x64 /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true /p:SelfContained=false -o "./../../win-publish/" /p:Version=${{ needs.version.outputs.v }}
- name: Rename Windows Output
shell: pwsh
run: |
Get-ChildItem "./win-publish/*.exe" | Rename-Item -NewName "BedrockBoot-x86_64-win.exe"
- name: Upload Windows Artifact
uses: actions/upload-artifact@v4
with:
name: windows-artifact
path: ./win-publish/*.exe
retention-days: 1
# 3. Linux 构建任务
linux-build:
runs-on: ubuntu-latest
needs: version
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x
- name: Build Linux
run: |
./build-appimage.sh ./src/BedrockBoot/BedrockBoot.csproj "BedrockBoot" ./assets/BedrockBoot.Icon.512x.png -version ${{ needs.version.outputs.v }}
- name: Upload Linux Artifact
uses: actions/upload-artifact@v4
with:
name: linux-artifact
path: ./artifacts
retention-days: 1