修复启动信息错位 #4
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: Build & Release | |
| on: | |
| workflow_dispatch: | |
| push: | |
| pull_request_target: | |
| permissions: write-all | |
| jobs: | |
| build_mod: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v3 | |
| - name: Setup .NET 8.x | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '8.x' | |
| - uses: clansty/checkout@main | |
| with: | |
| repository: 'MewoLab/AquaMai-Build-Assets' | |
| path: "AquaMai-Build-Assets" | |
| token: ${{ secrets.PATGH }} | |
| max-attempts: 50 | |
| min-retry-interval: 1 | |
| max-retry-interval: 5 | |
| - name: Copy Libs | |
| run: cp AquaMai-Build-Assets/WorldLinkLibs/* mod/Libs/ | |
| - name: Build .NET Mod | |
| run: | | |
| cd mod | |
| dotnet tool restore | |
| dotnet cake | |
| - name: Rename Artifacts | |
| run: | | |
| mkdir Artifacts | |
| mv mod/bin/Release/net472/WorldLink.dll Artifacts | |
| mv mod/WorldLink.toml Artifacts | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: Mod | |
| path: Artifacts | |
| build_deploy_frontend: | |
| runs-on: ubuntu-latest | |
| # Grant GITHUB_TOKEN the permissions required to make a Pages deployment | |
| permissions: | |
| pages: write # to deploy to Pages | |
| id-token: write # to verify the deployment originates from an appropriate source | |
| # Deploy to the github-pages environment | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v3 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Build frontend | |
| run: | | |
| cd rooms | |
| bun install | |
| bun run build | |
| cp -r dist ../src/main/resources/ | |
| rm -rf dist | |
| VITE_WL_BUILD_PROD=true bun run build | |
| - name: Upload pages build | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: rooms/dist | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action | |
| build_jar_docker: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v3 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: temurin | |
| java-version: '21' | |
| - name: Grant Gradle permissions | |
| run: chmod +x gradlew | |
| - name: Build fat JAR | |
| run: ./gradlew clean buildFatJar | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: Server | |
| path: build/libs/worldlinkd.jar | |
| - run: cp build/libs/worldlinkd.jar worldlinkd.jar | |
| - name: OCI meta | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ghcr.io/${{ github.repository }} | |
| tags: | | |
| type=ref,event=branch | |
| type=ref,event=pr | |
| type=semver,pattern={{version}} | |
| type=sha | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| push: ${{ github.actor != 'dependabot[bot]' }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| platforms: linux/amd64 | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| release: | |
| runs-on: ubuntu-latest | |
| if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
| needs: | |
| - build_mod | |
| - build_jar_docker | |
| steps: | |
| - name: get Mod | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: Mod | |
| - name: get Server | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: Server | |
| - name: Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| name: "Release ${{ github.ref_name }}" | |
| draft: false | |
| prerelease: false | |
| files: | | |
| worldlinkd.jar | |
| WorldLink.dll | |
| WorldLink.toml | |
| token: ${{ secrets.GITHUB_TOKEN }} |