update docker and release workflow
This commit is contained in:
@@ -1,57 +0,0 @@
|
||||
name: Sing-box Docker Image CI
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Get latest release
|
||||
id: get_release
|
||||
run: |
|
||||
latest_release=$(curl -Ls "https://api.github.com/repos/sagernet/sing-box/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
|
||||
echo "latest_release: $latest_release"
|
||||
echo "latest_release=$latest_release" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: |
|
||||
alireza7/s-ui-singbox
|
||||
ghcr.io/alireza0/s-ui-singbox
|
||||
tags: |
|
||||
type=sha
|
||||
type=pep440,pattern=${{ steps.get_release.outputs.latest_release }}
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
||||
|
||||
- name: Login to GHCR
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: core/
|
||||
push: true
|
||||
build-args: SINGBOX_VER=${{ steps.get_release.outputs.latest_release }}
|
||||
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/386
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
@@ -60,7 +60,7 @@ jobs:
|
||||
cd ..
|
||||
mv frontend/dist backend/web/html
|
||||
|
||||
- name: Build s-ui & singbox
|
||||
- name: Build s-ui
|
||||
run: |
|
||||
export CGO_ENABLED=1
|
||||
export GOOS=linux
|
||||
@@ -88,27 +88,15 @@ jobs:
|
||||
export CC=s390x-linux-gnu-gcc
|
||||
fi
|
||||
|
||||
#### Build Sing-Box
|
||||
export VERSION=v1.10.1
|
||||
git clone -b $VERSION https://github.com/SagerNet/sing-box
|
||||
cd sing-box
|
||||
go build -tags with_quic,with_grpc,with_wireguard,with_ech,with_utls,with_reality_server,with_acme,with_v2ray_api,with_clash_api,with_gvisor \
|
||||
-v -trimpath -ldflags "-X 'github.com/sagernet/sing-box/constant.Version=${VERSION}' -s -w -buildid=" \
|
||||
-o sing-box ./cmd/sing-box
|
||||
cd ..
|
||||
|
||||
### Build s-ui
|
||||
cd backend
|
||||
go build -o ../sui main.go
|
||||
go build -ldflags="-w -s" -tags "with_quic,with_grpc,with_ech,with_utls,with_reality_server,with_acme,with_gvisor" -o ../sui main.go
|
||||
cd ..
|
||||
|
||||
mkdir s-ui
|
||||
cp sui s-ui/
|
||||
cp s-ui.service s-ui/
|
||||
cp sing-box.service s-ui/
|
||||
mkdir s-ui/bin
|
||||
cp sing-box/sing-box s-ui/bin/
|
||||
cp core/runSingbox.sh s-ui/bin/
|
||||
cp s-ui.sh s-ui/
|
||||
|
||||
- name: Package
|
||||
run: tar -zcvf s-ui-linux-${{ matrix.platform }}.tar.gz s-ui
|
||||
|
||||
Reference in New Issue
Block a user