Skip to content

Commit

Permalink
multi builds
Browse files Browse the repository at this point in the history
  • Loading branch information
PuerNya committed Jul 1, 2024
1 parent a3fdaa3 commit 5b26e36
Show file tree
Hide file tree
Showing 9 changed files with 278 additions and 406 deletions.
28 changes: 0 additions & 28 deletions .github/renovate.json

This file was deleted.

5 changes: 0 additions & 5 deletions .github/update_dependencies.sh

This file was deleted.

140 changes: 140 additions & 0 deletions .github/workflows/core.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
name: Build Cores

on:
push:

jobs:
go:
runs-on: ubuntu-latest
outputs:
version: ${{steps.go.outputs.version}}
steps:
- name: get latest go version
id: go
run: |
echo version=$(curl -s https://raw.githubusercontent.com/actions/go-versions/update-versions-manifest-file/versions-manifest.json | grep -oE '"version": "[0-9]{1}.[0-9]{1,}(.[0-9]{1,})?"' | head -1 | cut -d':' -f2 | sed 's/ //g; s/"//g') >> $GITHUB_OUTPUT
sing-box:
runs-on: ubuntu-latest
needs: go
outputs:
version: ${{steps.sing-box.outputs.version}}
steps:
- uses: actions/checkout@v4.1.1
with:
fetch-depth: 0

- name: setup go
uses: actions/setup-go@v5.0.0
with:
go-version: ${{needs.go.outputs.version}}

- name: get sing-box version
id: sing-box
run: |
git remote add sekai https://github.com/SagerNet/sing-box.git
git fetch --tags sekai
version=$(CGO_ENABLED=0 go run ./cmd/internal/read_tag)
echo version=$version >> $GITHUB_OUTPUT
build-android:
runs-on: ubuntu-latest
needs:
- go
- sing-box
strategy:
matrix:
jobs:
- { goarch: '386', ndk: i686-linux-android34, output: '386' }
- { goarch: arm, ndk: armv7a-linux-androideabi34, output: armeabi-v7a }
- { goarch: arm64, ndk: aarch64-linux-android34, output: arm64-v8a }
- { goarch: amd64, ndk: x86_64-linux-android34, output: x86_64 }
env:
VERSION: ${{needs.sing-box.outputs.version}}
steps:
- uses: actions/checkout@v4.1.1
with:
fetch-depth: 0

- name: setup go
uses: actions/setup-go@v5.0.0
with:
go-version: ${{needs.go.outputs.version}}

- name: Setup NDK
uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r26b

- name: build core
env:
CC: ${{steps.setup-ndk.outputs.ndk-path}}/toolchains/llvm/prebuilt/linux-x86_64/bin/${{matrix.jobs.ndk}}-clang
TAGS: with_quic,with_dhcp,with_wireguard,with_shadowsocksr,with_ech,with_utls,with_clash_api,with_gvisor
GOOS: android
GOARM: '7'
GOARCH: ${{matrix.jobs.goarch}}
CGO_ENABLED: '1'
run: go build -v -trimpath -ldflags "-X 'github.com/sagernet/sing-box/constant.Version=${VERSION}' -s -w -buildid=" -tags "${TAGS}" ./cmd/sing-box

- name: upload core
uses: actions/upload-artifact@v4.1.0
with:
name: sing-box-${{env.VERSION}}-android-${{matrix.jobs.output}}
path: sing-box
compression-level: 9

build-other-platform:
runs-on: ubuntu-latest
needs:
- go
- sing-box
strategy:
matrix:
jobs:
- { goos: darwin, goarch: arm64, goamd64: v1, gomips: '', output: arm64 }
- { goos: darwin, goarch: amd64, goamd64: v1, gomips: '', output: amd64 }
- { goos: linux, goarch: '386', goamd64: v1, gomips: '', output: '386' }
- { goos: linux, goarch: arm64, goamd64: v1, gomips: '', output: arm64 }
- { goos: linux, goarch: amd64, goamd64: v1, gomips: '', output: x86_64 }
- { goos: linux, goarch: amd64, goamd64: v3, gomips: '', output: x86_64_v3 }
- { goos: linux, goarch: mips, goamd64: v1, gomips: '', output: mips }
- { goos: linux, goarch: mips, goamd64: v1, gomips: 'softfloat', output: mips_softfloat }
- { goos: linux, goarch: mips64, goamd64: v1, gomips: '', output: mips64 }
- { goos: linux, goarch: mips64, goamd64: v1, gomips: 'softfloat', output: mips64_softfloat }
- { goos: linux, goarch: mipsle, goamd64: v1, gomips: '', output: mips_little_endian }
- { goos: linux, goarch: mips64le, goamd64: v1, gomips: '', output: mips64_little_endian }
- { goos: windows, goarch: '386', goamd64: v1, gomips: '', output: '386' }
- { goos: windows, goarch: arm64, goamd64: v1, gomips: '', output: arm64 }
- { goos: windows, goarch: amd64, goamd64: v1, gomips: '', output: x86_64 }
- { goos: windows, goarch: amd64, goamd64: v3, gomips: '', output: x86_64_v3 }
env:
GOOS: ${{matrix.jobs.goos}}
VERSION: ${{needs.sing-box.outputs.version}}
steps:
- uses: actions/checkout@v4.1.1
with:
fetch-depth: 0

- name: setup go
uses: actions/setup-go@v5.0.0
with:
go-version: ${{needs.go.outputs.version}}

- name: build core
env:
TAGS: with_quic,with_dhcp,with_wireguard,with_shadowsocksr,with_ech,with_utls,with_reality_server,with_clash_api,with_gvisor
GOARCH: ${{matrix.jobs.goarch}}
GOAMD64: ${{matrix.jobs.goamd64}}
GOMIPS: ${{matrix.jobs.gomips}}
CGO_ENABLED: '0'
run: go build -v -trimpath -ldflags "-X 'github.com/sagernet/sing-box/constant.Version=${VERSION}' -s -w -buildid=" -tags "${TAGS}" ./cmd/sing-box

- name: upload core
uses: actions/upload-artifact@v4.1.0
with:
name: sing-box-${{env.VERSION}}-${{env.GOOS}}-${{matrix.jobs.output}}
path: |
sing-box
sing-box.exe
compression-level: 9
220 changes: 0 additions & 220 deletions .github/workflows/debug.yml

This file was deleted.

Loading

0 comments on commit 5b26e36

Please sign in to comment.