diff --git a/.github/workflows/auto-build.yml b/.github/workflows/auto-build.yml index 893f733..0b41678 100644 --- a/.github/workflows/auto-build.yml +++ b/.github/workflows/auto-build.yml @@ -187,24 +187,13 @@ jobs: # target: linux/amd64, linux/arm64, windows/amd64 goos: [ linux, windows ] goarch: [ '386', amd64, arm64 ] - musl: [ '' ] - include: - - goos: linux - goarch: amd64 - musl: musl - - goos: linux - goarch: arm64 - musl: musl exclude: - goos: linux goarch: '386' - musl: '' - goos: windows goarch: arm64 - musl: '' - goos: windows goarch: '386' - musl: '' fail-fast: true steps: - name: Apt-get Update @@ -216,14 +205,11 @@ jobs: - name: Install Cross-compiler for Windows if: matrix.goos == 'windows' run: sudo apt-get -y install mingw-w64 - - name: Install Cross-compiler for Linux Arm64 - if: matrix.goos == 'linux' && matrix.goarch == 'arm64' && matrix.musl == '' - run: sudo apt-get -y install gcc-aarch64-linux-gnu - name: Install Cross-compiler for Linux Amd64 Musl - if: matrix.goos == 'linux' && matrix.goarch == 'amd64' && matrix.musl == 'musl' + if: matrix.goos == 'linux' && matrix.goarch == 'amd64' run: sudo apt-get -y install musl-tools - name: Install Cross-compiler for Linux Arm64 Musl - if: matrix.goos == 'linux' && matrix.goarch == 'arm64' && matrix.musl == 'musl' + if: matrix.goos == 'linux' && matrix.goarch == 'arm64' run: | curl -O https://musl.cc/aarch64-linux-musl-cross.tgz; tar zxf aarch64-linux-musl-cross.tgz; @@ -271,7 +257,6 @@ jobs: env: GOOS: ${{ matrix.goos }} GOARCH: ${{ matrix.goarch }} - MUSL: ${{ matrix.musl }} CUR_TIME: ${{ steps.currentTime.outputs.time }} working-directory: ./sealdice-core run: | @@ -286,20 +271,12 @@ jobs: elif [ $GOOS = 'windows' ] && [ $GOARCH = 'amd64' ]; then echo "CC=x86_64-w64-mingw32-gcc" >> $GITHUB_ENV; elif [ $GOOS = 'linux' ] && [ $GOARCH = 'amd64' ]; then - if [ $MUSL = 'musl' ]; then - echo "CC=musl-gcc" >> $GITHUB_ENV; - else - echo "CC=gcc" >> $GITHUB_ENV; - fi + echo "CC=musl-gcc" >> $GITHUB_ENV; elif [ $GOOS = 'linux' ] && [ $GOARCH = 'arm64' ]; then - if [ $MUSL = 'musl' ]; then - echo "CC=$(readlink -f ../aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc)" >> $GITHUB_ENV; - else - echo "CC=aarch64-linux-gnu-gcc" >> $GITHUB_ENV; - fi + echo "CC=$(readlink -f ../aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc)" >> $GITHUB_ENV; fi - name: Build Binary - if: matrix.musl == '' + if: matrix.goos != 'linux' env: GOOS: ${{ matrix.goos }} GOARCH: ${{ matrix.goarch }} @@ -310,8 +287,8 @@ jobs: SEAL_TRUSTED_PRIVATE_KEY: ${{ secrets.SEAL_TRUSTED_PRIVATE_KEY }} working-directory: ./sealdice-core run: go build -o "output/$BINARY_NAME" -trimpath -ldflags "-s -w -X sealdice-core/dice.VERSION_PRERELEASE=-beta -X sealdice-core/dice.VERSION_BUILD_METADATA=+${CUR_TIME}.${COMMIT_ID::7} -X sealdice-core/dice.APP_CHANNEL=beta -X 'sealdice-core/dice.DefaultSignUrl=${NT_SIGN_URL}' -X 'sealdice-core/dice.SealTrustedClientPrivateKey=${SEAL_TRUSTED_PRIVATE_KEY}'" . - - name: Build Binary (musl) - if: matrix.musl == 'musl' + - name: Build Binary (linux musl) + if: matrix.goos == 'linux' env: GOOS: ${{ matrix.goos }} GOARCH: ${{ matrix.goarch }} @@ -324,23 +301,15 @@ jobs: run: go build -tags musl -o "output/$BINARY_NAME" -trimpath -ldflags "-s -w -linkmode external -extldflags '-static' -X sealdice-core/dice.VERSION_PRERELEASE=-beta -X sealdice-core/dice.VERSION_BUILD_METADATA=+${CUR_TIME}.${COMMIT_ID::7} -X sealdice-core/dice.APP_CHANNEL=beta -X 'sealdice-core/dice.DefaultSignUrl=${NT_SIGN_URL}' -X 'sealdice-core/dice.SealTrustedClientPrivateKey=${SEAL_TRUSTED_PRIVATE_KEY}'" . - name: Run UPX uses: crazy-max/ghaction-upx@v3 - if: matrix.musl == '' with: version: latest files: ./sealdice-core/output/${{ env.BINARY_NAME }} args: -9 -fq - name: Upload Core uses: actions/upload-artifact@v4 - if: matrix.musl == '' with: name: sealdice-core_${{ env.PROJECT_VERSION_C }}_${{ matrix.goos }}_${{ matrix.goarch }} path: ./sealdice-core/output - - name: Upload Core (musl) - uses: actions/upload-artifact@v4 - if: matrix.musl == 'musl' - with: - name: sealdice-core_${{ env.PROJECT_VERSION_C }}_${{ matrix.goos }}_${{ matrix.goarch }}_musl - path: ./sealdice-core/output core-darwin-build: name: Build Core @@ -580,27 +549,15 @@ jobs: # target: linux/amd64, linux/arm64, windows/amd64, darwin/amd64, darwin/arm64 goos: [ linux, windows, darwin ] goarch: [ '386', amd64, arm64 ] - musl: [ '' ] - include: - - goos: linux - goarch: amd64 - musl: musl - - goos: linux - goarch: arm64 - musl: musl exclude: - goos: linux goarch: '386' - musl: '' - goos: windows goarch: arm64 - musl: '' - goos: windows goarch: '386' - musl: '' - goos: darwin goarch: '386' - musl: '' steps: - name: Get current time uses: Kaven-Universe/github-action-current-date-time@v1 @@ -621,23 +578,15 @@ jobs: - name: Get Lagrange uses: actions/download-artifact@v4 - if: matrix.musl == '' with: name: lagrange.${{ matrix.goos }}-${{ matrix.goarch }} path: ./lagrange/ - name: Get Core uses: actions/download-artifact@v4 - if: matrix.musl == '' with: name: sealdice-core_${{ env.PROJECT_VERSION_C }}_${{ matrix.goos }}_${{ matrix.goarch }} path: . - - name: Get Core (musl) - uses: actions/download-artifact@v4 - if: matrix.musl == 'musl' - with: - name: sealdice-core_${{ env.PROJECT_VERSION_C }}_${{ matrix.goos }}_${{ matrix.goarch }}_musl - path: . - name: Set Execute Attribute if: matrix.goos != 'windows' @@ -645,16 +594,9 @@ jobs: - name: Upload uses: actions/upload-artifact@v4 - if: matrix.musl == '' with: name: sealdice_${{ env.PROJECT_VERSION_C }}_${{ matrix.goos }}_${{ matrix.goarch }} path: . - - name: Upload (musl) - uses: actions/upload-artifact@v4 - if: matrix.musl == 'musl' - with: - name: sealdice_${{ env.PROJECT_VERSION_C }}_${{ matrix.goos }}_${{ matrix.goarch }}_musl - path: . preparation: name: Compressed Files Preparation @@ -694,6 +636,7 @@ jobs: echo "PROJECT_VERSION_C=${CUR_TIME}-${COMMIT_ID::7}" >> $GITHUB_ENV; env: CUR_TIME: ${{ steps.currentTime.outputs.time }} + - name: Get Files uses: actions/download-artifact@v4 with: @@ -811,12 +754,12 @@ jobs: - name: Get Amd64 Files uses: actions/download-artifact@v4 with: - name: sealdice_${{ env.PROJECT_VERSION_C }}_linux_amd64_musl + name: sealdice_${{ env.PROJECT_VERSION_C }}_linux_amd64 path: ./amd64/ - name: Get Arm64 Files uses: actions/download-artifact@v4 with: - name: sealdice_${{ env.PROJECT_VERSION_C }}_linux_arm64_musl + name: sealdice_${{ env.PROJECT_VERSION_C }}_linux_arm64 path: ./arm64/ - name: Chmod