name: Pull Request Check on: pull_request: types: [opened, synchronize, reopened] paths: - "**/*.go" - "service/**" - "core/**" - "gui/**" - ".github/workflows/*.yml" jobs: Build_v2rayA_Web: uses: ./.github/workflows/_build_web.yml Build_v2rayA: runs-on: ${{ matrix.os }} strategy: matrix: include: - { os: ubuntu-latest, goarch: amd64 } - { os: ubuntu-latest, goarch: arm64 } - { os: windows-latest, goarch: amd64 } - { os: windows-latest, goarch: arm64 } - { os: macos-latest, goarch: amd64 } - { os: macos-latest, goarch: arm64 } needs: Build_v2rayA_Web steps: - uses: actions/checkout@v7 with: fetch-depth: 0 - name: Download Artifact uses: actions/download-artifact@v8 with: name: web path: service/server/router/web - name: Set up Go uses: actions/setup-go@v6 with: cache-dependency-path: | service/go.mod service/go.sum go-version: "1.26" - name: Build v2rayA shell: bash run: | mkdir v2raya_bin CurrentDir="$(pwd)" date=$(git -C "$CurrentDir" log -1 --format="%cd" --date=short | sed s/-//g) count=$(git -C "$CurrentDir" rev-list --count HEAD) commit=$(git -C "$CurrentDir" rev-parse --short HEAD) version="unstable-$date.r${count}.$commit" case "${{ matrix.os }}" in windows-latest) os="windows"; ext=".exe" ;; macos-latest) os="darwin"; ext="" ;; ubuntu-latest) os="linux"; ext="" ;; esac cd "$CurrentDir"/service GOARCH="${{ matrix.goarch }}" CGO_ENABLED=0 go build -trimpath \ -ldflags "-X github.com/v2rayA/v2rayA/conf.Version=$version -s -w" \ -o "$CurrentDir/v2raya_bin/v2raya_pr_build_${os}_${{ matrix.goarch }}_${version}${ext}" cd "$CurrentDir"/core GOARCH="${{ matrix.goarch }}" CGO_ENABLED=0 go build -trimpath \ -ldflags "-X main.Version=$version -s -w" \ -o "$CurrentDir/v2raya_bin/v2raya_core_pr_build_${os}_${{ matrix.goarch }}_${version}${ext}" ./main - name: Upload v2rayA Binary uses: actions/upload-artifact@v7 with: name: v2raya_pr_build_${{ matrix.os }}_${{ matrix.goarch }} path: v2raya_bin/v2raya*