Build: Build list adjustment and compatibility code cleaning; Move OpenBSD out of regular releasing #1
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: Extended or Back-seated Nightly Build | |
| # Secondary builds are built here. | |
| # Failing maybe not a blocking. This depends on judgements. | |
| on: | |
| workflow_dispatch: | |
| push: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| jobs: | |
| build: | |
| permissions: | |
| contents: write | |
| strategy: | |
| matrix: | |
| include: | |
| - goos: freebsd | |
| goarch: amd64 | |
| assetname: ["freebsd-64"] | |
| - goos: freebsd | |
| goarch: arm64 | |
| assetname: ["freebsd-arm64-v8a"] | |
| - goos: freebsd | |
| goarch: 386 | |
| assetname: ["freebsd-32"] | |
| - goos: freebsd | |
| goarch: arm | |
| goarm: 7 | |
| assetname: ["freebsd-arm32-v7a"] | |
| - goos: openbsd | |
| goarch: amd64 | |
| assetname: ["openbsd-64"] | |
| - goos: openbsd | |
| goarch: arm64 | |
| assetname: ["openbsd-arm64-v8a"] | |
| - goos: openbsd | |
| goarch: 386 | |
| assetname: ["openbsd-32"] | |
| - goos: openbsd | |
| goarch: arm | |
| goarm: 7 | |
| assetname: ["openbsd-arm32-v7a"] | |
| fail-fast: false | |
| runs-on: ubuntu-latest | |
| env: | |
| GOOS: ${{ matrix.goos }} | |
| GOARCH: ${{ matrix.goarch }} | |
| GOARM: ${{ matrix.goarm }} | |
| CGO_ENABLED: 0 | |
| steps: | |
| - name: Checkout codebase | |
| uses: actions/checkout@v6 | |
| - name: Show workflow information | |
| run: | | |
| _NAME=${{ matrix.assetname }} | |
| echo "GOOS: $GOOS, GOARCH: $GOARCH, RELEASE_NAME: $_NAME" | |
| echo "ASSET_NAME=$_NAME" >> $GITHUB_ENV | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| check-latest: true | |
| - name: Get project dependencies | |
| run: go mod download | |
| - name: Build Xray | |
| run: | | |
| # Building | |
| mkdir -p build_assets | |
| COMMID=$(git describe --always --dirty) | |
| if [[ ${GOOS} == 'windows' ]]; then | |
| echo 'Building Xray for Windows...' | |
| go build -o build_assets/xray.exe -trimpath -buildvcs=false -gcflags="all=-l=4" -ldflags="-X github.com/xtls/xray-core/core.build=${COMMID} -s -w -buildid=" -v ./main | |
| else | |
| echo 'Building Xray...' | |
| if [[ ${GOARCH} == 'mips' || ${GOARCH} == 'mipsle' ]]; then | |
| go build -o build_assets/xray -trimpath -buildvcs=false -gcflags="-l=4" -ldflags="-X github.com/xtls/xray-core/core.build=${COMMID} -s -w -buildid=" -v ./main | |
| echo 'Building soft-float Xray for MIPS/MIPSLE 32-bit...' | |
| GOMIPS=softfloat go build -o build_assets/xray_softfloat -trimpath -buildvcs=false -gcflags="-l=4" -ldflags="-X github.com/xtls/xray-core/core.build=${COMMID} -s -w -buildid=" -v ./main | |
| else | |
| go build -o build_assets/xray -trimpath -buildvcs=false -gcflags="all=-l=4" -ldflags="-X github.com/xtls/xray-core/core.build=${COMMID} -s -w -buildid=" -v ./main | |
| fi | |
| fi | |
| - name: Copy README.md & LICENSE | |
| run: | | |
| cp ${GITHUB_WORKSPACE}/README.md ./build_assets/README.md | |
| cp ${GITHUB_WORKSPACE}/LICENSE ./build_assets/LICENSE | |
| - name: Upload files to Artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: Xray-${{ env.ASSET_NAME }} | |
| path: | | |
| ./build_assets/* |