Repository navigation
Merge remote-tracking branch 'origin/2.0-develop' into 2.0-develop #957
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 }} /p:BuildType=Preview | |
| - 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 }} /p:BuildType=Preview | |
| - name: Upload Linux Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux-artifact | |
| path: ./artifacts | |
| retention-days: 1 |