ci: 修复上传部分目录错误的问题 #25
Workflow file for this run
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 | |
| on: | |
| push: | |
| workflow_dispatch: | |
| inputs: | |
| release_tag: | |
| description: '发布标签' | |
| required: true | |
| type: string | |
| primary_version: | |
| description: '主发布版本' | |
| required: true | |
| type: string | |
| channels: | |
| description: '发布通道' | |
| required: true | |
| type: string | |
| is_test_mode: | |
| description: '是否处于测试发布模式' | |
| required: false | |
| type: boolean | |
| jobs: | |
| build_app: | |
| runs-on: windows-latest # For a list of available runner types, refer to | |
| # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on | |
| env: | |
| artifact_name: out_app_${{ matrix.os }}_${{ matrix.arch }} | |
| isTestMode: ${{ github.event.inputs.is_test_mode }} | |
| arch: ${{ matrix.arch }} | |
| strategy: | |
| matrix: | |
| arch: ['x64', 'x86', 'arm64'] | |
| os: ['win', 'linux'] | |
| include: | |
| - arch: any | |
| os: any | |
| exclude: | |
| - arch: x86 | |
| os: linux | |
| name: Build_${{ matrix.os }}_${{ matrix.arch }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| submodules: recursive | |
| - name: List files | |
| run: ls | |
| # Install the .NET Core workload | |
| - name: Install .NET Core | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: 8.0.x | |
| # Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild | |
| - name: Setup MSBuild.exe | |
| uses: microsoft/setup-msbuild@v1.0.2 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: pnpm | |
| cache-dependency-path: classisland.managementserver.client/pnpm-lock.yaml | |
| - name: Build application | |
| env: | |
| is_release: ${{ startsWith(github.ref, 'refs/tags/') }} | |
| arch: ${{ matrix.arch }} | |
| os: ${{ matrix.os }} | |
| run: | | |
| ls | |
| pwsh -ep Bypass -c ./tools/release-gen/publish.ps1 $env:os $env:arch | |
| - name: Upload Unsigned APP to artifacts | |
| id: upload-unsigned-artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ env.artifact_name }} | |
| path: | | |
| ./out/*.zip | |
| ./out/*.appx | |
| publish: | |
| runs-on: windows-latest | |
| name: Publish | |
| if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
| needs: [ build_app ] | |
| concurrency: | |
| group: "publish-public" | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| submodules: recursive | |
| - name: Get commit hash | |
| uses: prompt/actions-commit-hash@v3 | |
| id: commit | |
| with: | |
| prefix: "${{ github.event.inputs.release_tag }}+" | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: ./out_artifacts | |
| - name: Process Artifacts | |
| run: pwsh -ep bypass ./tools/release-gen/proc-artifacts.ps1 | |
| - name: Generate SHA256 | |
| run: pwsh -ep bypass ./tools/release-gen/gen-hash.ps1 ./out | |
| - name: Upload APP to release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| artifacts: "./out/*.zip,./out/*.appx" | |
| draft: true | |
| bodyFile: ./out/checksums.md | |
| token: ${{ secrets.GITHUB_TOKEN }} |