single multiplatform build for shadowsockets-rust
Some checks failed
CI / Build shadowsocks-rust docker images (push) Has been cancelled
Some checks failed
CI / Build shadowsocks-rust docker images (push) Has been cancelled
This commit is contained in:
@@ -22,33 +22,18 @@ jobs:
|
|||||||
username: woggioni
|
username: woggioni
|
||||||
password: ${{ secrets.PUBLISHER_TOKEN }}
|
password: ${{ secrets.PUBLISHER_TOKEN }}
|
||||||
-
|
-
|
||||||
name: Build and push sserver-rust amd64 image
|
name: Build and push sserver-rust images
|
||||||
uses: docker/build-push-action@v5.3.0
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: "{{defaultContext}}:shadowsocks-rust"
|
context: "{{defaultContext}}:shadowsocks-rust"
|
||||||
platforms: linux/amd64
|
platforms: |
|
||||||
|
linux/amd64
|
||||||
|
linux/arm64
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
"gitea.woggioni.net/woggioni/sserver-rust:latest"
|
"gitea.woggioni.net/woggioni/sserver-rust:latest"
|
||||||
"gitea.woggioni.net/woggioni/sserver-rust:v1.20.1"
|
"gitea.woggioni.net/woggioni/sserver-rust:v1.20.1"
|
||||||
build-args: |
|
build-args: "VERSION=1.20.1"
|
||||||
"TARGETARCH=amd64"
|
|
||||||
"VERSION=1.20.1"
|
|
||||||
cache-from: type=registry,ref=gitea.woggioni.net/woggioni/sserver-rust:buildx
|
|
||||||
cache-to: type=registry,mode=max,compression=zstd,image-manifest=true,oci-mediatypes=true,ref=gitea.woggioni.net/woggioni/sserver-rust:buildx
|
|
||||||
-
|
|
||||||
name: Build and push sserver-rust arm64 image
|
|
||||||
uses: docker/build-push-action@v5.3.0
|
|
||||||
with:
|
|
||||||
context: "{{defaultContext}}:shadowsocks-rust"
|
|
||||||
platforms: linux/arm64
|
|
||||||
push: true
|
|
||||||
tags: |
|
|
||||||
"gitea.woggioni.net/woggioni/sserver-rust:latest"
|
|
||||||
"gitea.woggioni.net/woggioni/sserver-rust:v1.20.1"
|
|
||||||
build-args: |
|
|
||||||
"TARGETARCH=arm64"
|
|
||||||
"VERSION=1.20.1"
|
|
||||||
cache-from: type=registry,ref=gitea.woggioni.net/woggioni/sserver-rust:buildx
|
cache-from: type=registry,ref=gitea.woggioni.net/woggioni/sserver-rust:buildx
|
||||||
cache-to: type=registry,mode=max,compression=zstd,image-manifest=true,oci-mediatypes=true,ref=gitea.woggioni.net/woggioni/sserver-rust:buildx
|
cache-to: type=registry,mode=max,compression=zstd,image-manifest=true,oci-mediatypes=true,ref=gitea.woggioni.net/woggioni/sserver-rust:buildx
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
FROM --platform=$BUILDPLATFORM rust:alpine3.20 AS builder
|
FROM --platform=$TARGETPLATFORM rust:alpine AS builder
|
||||||
|
|
||||||
ARG TARGETARCH VERSION
|
ARG VERSION TARGETPLATFORM
|
||||||
|
|
||||||
RUN set -x \
|
RUN set -x \
|
||||||
&& apk add --no-cache build-base cmake llvm15-dev clang15-libclang clang15 rust-bindgen git
|
&& apk add --no-cache build-base cmake llvm15-dev clang15-libclang clang15 rust-bindgen git
|
||||||
@@ -9,7 +9,7 @@ WORKDIR /root/shadowsocks-rust
|
|||||||
|
|
||||||
RUN git clone --depth 1 --branch "v${VERSION}" https://github.com/shadowsocks/shadowsocks-rust.git .
|
RUN git clone --depth 1 --branch "v${VERSION}" https://github.com/shadowsocks/shadowsocks-rust.git .
|
||||||
|
|
||||||
RUN case "$TARGETARCH" in \
|
RUN case "$TARGETPLATFORM" in \
|
||||||
"386") \
|
"386") \
|
||||||
RUST_TARGET="i686-unknown-linux-musl" \
|
RUST_TARGET="i686-unknown-linux-musl" \
|
||||||
MUSL="i686-linux-musl" \
|
MUSL="i686-linux-musl" \
|
||||||
@@ -22,8 +22,12 @@ RUN case "$TARGETARCH" in \
|
|||||||
RUST_TARGET="aarch64-unknown-linux-musl" \
|
RUST_TARGET="aarch64-unknown-linux-musl" \
|
||||||
MUSL="aarch64-linux-musl" \
|
MUSL="aarch64-linux-musl" \
|
||||||
;; \
|
;; \
|
||||||
|
"linux/arm/v7") \
|
||||||
|
RUST_TARGET="arm-unknown-linux-musleabihf" \
|
||||||
|
MUSL="arm-linux-musleabihf" \
|
||||||
|
;; \
|
||||||
*) \
|
*) \
|
||||||
echo "Doesn't support $TARGETARCH architecture" \
|
echo "Doesn't support $TARGETPLATFORM architecture" \
|
||||||
exit 1 \
|
exit 1 \
|
||||||
;; \
|
;; \
|
||||||
esac \
|
esac \
|
||||||
|
Reference in New Issue
Block a user