|
| 1 | +name: Build patched Go 1.25 for tests |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + schedule: |
| 6 | + - cron: '30 0 * * 4,6' |
| 7 | + push: |
| 8 | + branches: |
| 9 | + - build |
| 10 | + - "release-branch.go1.25" |
| 11 | + paths: |
| 12 | + - ".github/workflows/test-go1_25.yml" |
| 13 | + - "**/*.go" |
| 14 | + pull_request: |
| 15 | + types: [opened, synchronize, reopened] |
| 16 | + branches: |
| 17 | + - build |
| 18 | + - "release-branch.go1.25" |
| 19 | + paths: |
| 20 | + - ".github/workflows/test-go1_25.yml" |
| 21 | + - "**/*.go" |
| 22 | + |
| 23 | +jobs: |
| 24 | + build: |
| 25 | + runs-on: ubuntu-latest |
| 26 | + permissions: |
| 27 | + contents: write |
| 28 | + strategy: |
| 29 | + matrix: |
| 30 | + goos: [windows] |
| 31 | + goarch: [amd64, 386] |
| 32 | + buildtarget: ['release-branch.go1.25'] |
| 33 | + fail-fast: false |
| 34 | + env: |
| 35 | + GOOS: ${{ matrix.goos }} |
| 36 | + GOARCH: ${{ matrix.goarch }} |
| 37 | + CGO_ENABLED: 0 |
| 38 | + steps: |
| 39 | + - name: Show workflow information |
| 40 | + run: | |
| 41 | + _NAME="$GOOS-$GOARCH" |
| 42 | + echo "GOOS: $GOOS, GOARCH: $GOARCH, APPLY-BRANCH: ${{ matrix.buildtarget }}" |
| 43 | + echo "ASSET_NAME=$_NAME" >> $GITHUB_ENV |
| 44 | +
|
| 45 | + - name: Download source |
| 46 | + uses: actions/checkout@v4 |
| 47 | + with: |
| 48 | + repository: 'golang/go' |
| 49 | + ref: ${{ matrix.buildtarget }} |
| 50 | + |
| 51 | + # Patches for Go 1.25.x before more minor changes introduces. |
| 52 | + - name: Apply patch |
| 53 | + run: | |
| 54 | + curl -L -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://github.com/XTLS/go-win7/raw/refs/heads/build/unified-1-25-patch.diff | patch --verbose -p 1 |
| 55 | + # curl -L -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://github.com/XTLS/go-win7/commit/830f1acfc984be44520621b001096845ebf40c7a.diff | patch --verbose -p 1 |
| 56 | + # curl -L -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://github.com/XTLS/go-win7/commit/b5e4a6d5b3d0b076414d04cc3d6002f816bc0c25.diff | patch --verbose -p 1 |
| 57 | + # curl -L -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://github.com/XTLS/go-win7/commit/949393bde276adbeaf41688f086feb23e24abe88.diff | patch --verbose -p 1 |
| 58 | + # curl -L -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://github.com/XTLS/go-win7/commit/fc29c4ae1cd53d6761d4324c4625cc8a149c55d3.diff | patch --verbose -p 1 |
| 59 | + |
| 60 | + - name: Set-up Go |
| 61 | + uses: actions/setup-go@v5 |
| 62 | + with: |
| 63 | + #go-version-file: 'src/go.mod' |
| 64 | + check-latest: true |
| 65 | + |
| 66 | + - name: Build patched Go |
| 67 | + shell: bash |
| 68 | + run: | |
| 69 | + cd ./src |
| 70 | + . ./make.bash "$@" --no-banner |
| 71 | + ../bin/go tool dist banner |
| 72 | + cd .. |
| 73 | +
|
| 74 | + - name: Copy binaries into bin |
| 75 | + if: matrix.goos != 'linux' || matrix.goarch != 'amd64' |
| 76 | + shell: bash |
| 77 | + run: | |
| 78 | + cd ./bin |
| 79 | + DIR="${GOOS}_${GOARCH}" |
| 80 | + if [ -d "${DIR}" ]; then |
| 81 | + echo "Found ${DIR} copying binaries" |
| 82 | + rm ./go* |
| 83 | + for BINARY in "${DIR}"/* |
| 84 | + do |
| 85 | + echo "mv ./${BINARY} ./" |
| 86 | + mv ./${BINARY} ./ |
| 87 | + done |
| 88 | + rm -r ./"${DIR}" |
| 89 | + rm -r ../pkg/tool/linux_amd64/ |
| 90 | + fi |
| 91 | + cd .. |
| 92 | + ls -al ./bin |
| 93 | +
|
| 94 | + - name: Upload package to Artifacts |
| 95 | + uses: actions/upload-artifact@v4 |
| 96 | + with: |
| 97 | + name: go-for-win7-${{ env.ASSET_NAME }} |
| 98 | + path: | |
| 99 | + ./* |
0 commit comments