Skip to content

Build: Build list adjustment and compatibility code cleaning; Move OpenBSD out of regular releasing #9

Build: Build list adjustment and compatibility code cleaning; Move OpenBSD out of regular releasing

Build: Build list adjustment and compatibility code cleaning; Move OpenBSD out of regular releasing #9

name: Extended or Back-seated Nightly Build
# Secondary builds are built here.
# Failing maybe not meaning a blocking. This is a judgement call.
on:
workflow_dispatch:
push:
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
permissions:
contents: write
strategy:
matrix:
include:
- goos: openbsd
goarch: amd64
assetname: openbsd-64
- goos: openbsd
goarch: arm64
assetname: openbsd-arm64-v8a
- goos: openbsd
goarch: arm
assetname: openbsd-arm32-v7a
- goos: openbsd
goarch: 386
assetname: openbsd-32
fail-fast: false
runs-on: ubuntu-latest
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
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: |
if [[ ${GOARCH} == 'arm' ]]; then
GOARM="7"
fi
# 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 -ldflags="-X github.com/xtls/xray-core/core.build=${COMMID} -s -w -buildid=" -v ./main
else
echo 'Building Xray...'
go build -o build_assets/xray -trimpath -buildvcs=false -ldflags="-X github.com/xtls/xray-core/core.build=${COMMID} -s -w -buildid=" -v ./main
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/*