up 删除aot发布 #247
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: ColorMC构建与发布 | |
| on: | |
| push: | |
| # Sequence of patterns matched against refs/heads | |
| branches: | |
| - 'releases/**' | |
| # Sequence of patterns matched against refs/tags | |
| tags: | |
| - '**' | |
| jobs: | |
| build-linux: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| with: | |
| submodules: 'true' | |
| - name: 设置.NET Core | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 10.0.103 | |
| - name: Read version number | |
| id: version | |
| run: | | |
| VERSION=$(cat ./build/version) | |
| echo "VERSION=$VERSION" >> $GITHUB_ENV | |
| - name: 构建源码 | |
| shell: bash | |
| working-directory: ./ | |
| run: | | |
| chmod a+x ./build/build-linux.sh | |
| ./build/build-linux.sh | |
| - name: 构建 deb | |
| shell: bash | |
| working-directory: ./ | |
| run: | | |
| chmod a+x ./build/build-ubuntu.sh | |
| ./build/build-ubuntu.sh | |
| - name: 构建 rpm | |
| shell: bash | |
| working-directory: ./ | |
| run: | | |
| chmod a+x ./build/build-rpm.sh | |
| ./build/build-rpm.sh | |
| - name: 构建 pkg | |
| run: | | |
| docker run --name build-container -v "${{ github.workspace }}:/github/workspace" archlinux:latest /bin/bash -c "\ | |
| pacman -Syu --noconfirm base-devel git && \ | |
| useradd -m builder && \ | |
| cd /github/workspace && \ | |
| chown -R builder:builder /github/workspace/ && \ | |
| chmod -R 777 /github/workspace/ && \ | |
| echo 'builder ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/builder && \ | |
| sudo -u builder ./build/build-arch.sh" | |
| - name: 上传 colormc-linux-x86_64-rpm | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "colormc-linux-x86_64-rpm" | |
| path: build_out/colormc-linux-${{ env.VERSION }}-1.x86_64.rpm | |
| - name: 上传 colormc-linux-min-x86_64-rpm | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "colormc-linux-min-x86_64-rpm" | |
| path: build_out/colormc-linux-${{ env.VERSION }}-1-min.x86_64.rpm | |
| - name: 上传 colormc-linux-aarch64-rpm | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "colormc-linux-aarch64-rpm" | |
| path: build_out/colormc-linux-${{ env.VERSION }}-1.aarch64.rpm | |
| - name: 上传 colormc-linux-min-aarch64-rpm | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "colormc-linux-min-aarch64-rpm" | |
| path: build_out/colormc-linux-${{ env.VERSION }}-1-min.aarch64.rpm | |
| - name: 上传 colormc-linux-x86_64-pkg | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "colormc-linux-x86_64-pkg" | |
| path: build_out/colormc-linux-${{ env.VERSION }}-1-x86_64.pkg.tar.zst | |
| - name: 上传 colormc-linux-min-x86_64-pkg | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "colormc-linux-min-x86_64-pkg" | |
| path: build_out/colormc-linux-${{ env.VERSION }}-1-min-x86_64.pkg.tar.zst | |
| - name: 上传 colormc-linux-amd64-deb | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "colormc-linux-amd64-deb" | |
| path: build_out/colormc-linux-${{ env.VERSION }}-amd64.deb | |
| - name: 上传 colormc-linux-min-amd64-deb | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "colormc-linux-min-amd64-deb" | |
| path: build_out/colormc-linux-${{ env.VERSION }}-min-amd64.deb | |
| - name: 上传 colormc-linux-aarch64-deb | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "colormc-linux-aarch64-deb" | |
| path: build_out/colormc-linux-${{ env.VERSION }}-arm64.deb | |
| - name: 上传 colormc-linux-min-aarch64-deb | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "colormc-linux-min-aarch64-deb" | |
| path: build_out/colormc-linux-${{ env.VERSION }}-min-arm64.deb | |
| - name: 上传 linux-x64-appimage.deb | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "colormc-linux-x86_64-appimage" | |
| path: build_out/colormc-linux-${{ env.VERSION }}-x86_64.AppImage | |
| - name: 上传 colormc-linux-min-x86_64-appimage | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "colormc-linux-min-x86_64-appimage" | |
| path: build_out/colormc-linux-${{ env.VERSION }}-min-x86_64.AppImage | |
| build-macos: | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| with: | |
| submodules: 'true' | |
| - name: 设置.NET Core | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 10.0.103 | |
| - name: Read version number | |
| id: version | |
| run: | | |
| VERSION=$(cat ./build/version) | |
| echo "VERSION=$VERSION" >> $GITHUB_ENV | |
| - name: 构建 | |
| shell: bash | |
| working-directory: ./ | |
| run: | | |
| chmod a+x ./build/build-macos.sh | |
| ./build/build-macos.sh | |
| ./build/build-dmg.sh | |
| - name: 上传 colormc-macos-x86_64 | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "colormc-macos-x86_64" | |
| path: build_out/colormc-macos-${{ env.VERSION }}-x86_64.zip | |
| - name: 上传 colormc-macos-min-x86_64 | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "colormc-macos-min-x86_64" | |
| path: build_out/colormc-macos-${{ env.VERSION }}-min-x86_64.zip | |
| - name: 上传 colormc-macos-aarch64 | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "colormc-macos-aarch64" | |
| path: build_out/colormc-macos-${{ env.VERSION }}-aarch64.zip | |
| - name: 上传 colormc-macos-min-aarch64 | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "colormc-macos-min-aarch64" | |
| path: build_out/colormc-macos-${{ env.VERSION }}-min-aarch64.zip | |
| - name: 上传 colormc-macos-x86_64-dmg | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "colormc-macos-x86_64-dmg" | |
| path: build_out/colormc-macos-${{ env.VERSION }}-x86_64.dmg | |
| - name: 上传 colormc-macos-min-x86_64-dmg | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "colormc-macos-min-x86_64-dmg" | |
| path: build_out/colormc-macos-${{ env.VERSION }}-min-x86_64.dmg | |
| - name: 上传 colormc-macos-aarch64-dmg | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "colormc-macos-aarch64-dmg" | |
| path: build_out/colormc-macos-${{ env.VERSION }}-aarch64.dmg | |
| - name: 上传 colormc-macos-min-aarch64-dmg | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "colormc-macos-min-aarch64-dmg" | |
| path: build_out/colormc-macos-${{ env.VERSION }}-min-aarch64.dmg | |
| build-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| with: | |
| submodules: 'true' | |
| - name: Read version number | |
| id: version | |
| run: | | |
| $version = Get-Content ./build/version | |
| echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
| - name: 设置.NET Core | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 10.0.103 | |
| - name: 构建 源码 | |
| shell: cmd | |
| working-directory: ./ | |
| run: ./build/build-windows.cmd | |
| - name: Build MSI with MSBuild | |
| working-directory: ./ | |
| run: ./build/build-msi.cmd | |
| - name: 上传 colormc-windows-x64-msi | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "colormc-windows-x64-msi" | |
| path: src/ColorMC.Setup.Wix/colormc-windows-${{ env.VERSION }}-x64.msi | |
| - name: 上传 colormc-windows-x64-min-msi | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "colormc-windows-x64-min-msi" | |
| path: src/ColorMC.Setup.Wix/colormc-windows-${{ env.VERSION }}-min-x64.msi | |
| - name: 上传 colormc-windows-x86_64 | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "colormc-windows-x86_64" | |
| path: build_out/win-x64-dotnet/** | |
| - name: 上传 colormc-windows-min-x86_64 | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "colormc-windows-min-x86_64" | |
| path: build_out/win-x64-min/** | |
| - name: 上传 colormc-windows-x86 | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "colormc-windows-x86" | |
| path: build_out/win-x86-dotnet/** | |
| - name: 上传 colormc-windows-arm64 | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "colormc-windows-arm64" | |
| path: build_out/win-arm64-dotnet/** | |
| - name: 上传 colormc-windows-min-arm64 | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "colormc-windows-min-arm64" | |
| path: build_out/win-arm64-min/** | |
| release: | |
| if: startsWith(github.ref, 'refs/tags/') && !startsWith(github.ref_name, 'debug') | |
| needs: [build-linux, build-macos, build-windows] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: 检查是否为debug标签 | |
| run: | | |
| echo "当前标签: ${{ github.ref_name }}" | |
| echo "这不是debug标签,继续发布流程" | |
| - name: 下载所有构建产物 | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts/ | |
| - name: 列出所有下载的产物 | |
| run: | | |
| echo "下载的构建产物:" | |
| find artifacts/ -type f \( -name "*.deb" -o -name "*.rpm" -o -name "*.AppImage" -o -name "*.zip" -o -name "*.dmg" -o -name "*.msi" -o -name "*.pkg.tar.zst" -o -name "*.exe" \) | while read file; do | |
| echo " - $(basename "$file")" | |
| done | |
| - name: 创建GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| name: Release ${{ github.ref_name }} | |
| body: | | |
| ColorMC 构建产物 - ${{ github.ref_name }} | |
| 包含以下平台的构建: | |
| - Linux (.deb, .rpm, .AppImage, .pkg.tar.zst) | |
| - macOS (.zip, .dmg) | |
| - Windows (.msi, 可执行文件) | |
| 构建时间: ${{ github.event.head_commit.timestamp }} | |
| files: | | |
| artifacts/**/*.deb | |
| artifacts/**/*.rpm | |
| artifacts/**/*.AppImage | |
| artifacts/**/*.zip | |
| artifacts/**/*.dmg | |
| artifacts/**/*.msi | |
| artifacts/**/*.pkg.tar.zst | |
| artifacts/**/*.exe | |
| draft: false | |
| prerelease: false |