-
Notifications
You must be signed in to change notification settings - Fork 12
118 lines (102 loc) · 3.11 KB
/
Copy pathdevelop_push.yml
File metadata and controls
118 lines (102 loc) · 3.11 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: 验证代码
on:
workflow_dispatch:
push:
branches: ["**"]
permissions:
contents: write
jobs:
license:
runs-on: ubuntu-latest
if: github.actor != 'roundstudio'
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
token: ${{ secrets.ROUNDSTUDIOBOT_TOKEN }}
- name: Run license header script
shell: pwsh
run: |
./tools/Update-LicenseHeader.ps1
exit 0
- name: Commit and push if changed
shell: bash
run: |
git config user.name "RoundStudio Bot"
git config user.email "roundstudio@roundstudio.top"
git add -A
if git diff --cached --quiet; then
echo "No license header changes."
else
git commit -m "chore: normalize license headers [skip ci]"
git push origin HEAD:${{ github.ref_name }}
fi
version:
runs-on: ubuntu-latest
needs: license
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
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
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