fix: release permission

This commit is contained in:
zijiren233 2024-09-18 23:34:27 +08:00
parent 178cf5a202
commit 1fa53d0635
5 changed files with 23 additions and 11 deletions

View File

@ -52,6 +52,7 @@ jobs:
run: |
sudo BUILD_CONFIG=script/build.config.sh bash \
script/build.sh \
--enable-micro \
--skip-init-web \
--platforms="${{ matrix.target }}" \
--more-go-cmd-args='-a -v -x'

View File

@ -51,7 +51,12 @@ jobs:
- name: Build
run: |
BUILD_CONFIG=script/build.config.sh bash script/build.sh --version="v${{ steps.get_version.outputs.VERSION }}" --platforms="${{ matrix.target }}" --more-go-cmd-args='-a -v'
sudo BUILD_CONFIG=script/build.config.sh bash \
script/build.sh \
--enable-micro \
--version="v${{ steps.get_version.outputs.VERSION }}" \
--platforms="${{ matrix.target }}" \
--more-go-cmd-args='-a -v'
- name: Release
uses: softprops/action-gh-release@v2

View File

@ -45,7 +45,12 @@ jobs:
- name: Build
run: |
BUILD_CONFIG=script/build.config.sh bash script/build.sh --version=dev --platforms="${{ matrix.target }}" --more-go-cmd-args='-a -v -x'
sudo BUILD_CONFIG=script/build.config.sh bash \
script/build.sh \
--enable-micro \
--version=dev \
--platforms="${{ matrix.target }}" \
--more-go-cmd-args='-a -v -x'
- name: Release
uses: softprops/action-gh-release@v2

View File

@ -15,8 +15,9 @@ COPY ./ ./
RUN apk add --no-cache bash curl git go g++
RUN bash script/build.sh --version=${VERSION} \
--disable-micro --bin-name-no-suffix \
--force-gcc='gcc -static' --force-g++='g++ -static' \
--bin-name-no-suffix \
--force-gcc='gcc -static' \
--force-g++='g++ -static' \
--more-go-cmd-args='-a -v'
FROM alpine:latest

View File

@ -60,7 +60,7 @@ function printEnvHelp() {
echo -e " ${COLOR_LIGHT_CYAN}BIN_NAME${COLOR_RESET} - Set the binary name (default: source directory basename)."
echo -e " ${COLOR_LIGHT_CYAN}BIN_NAME_NO_SUFFIX${COLOR_RESET} - Do not append the architecture suffix to the binary name."
echo -e " ${COLOR_LIGHT_CYAN}PLATFORM${COLOR_RESET} - Set the target platform(s) (default: host platform, supports: all, linux, linux/arm*, ...)."
echo -e " ${COLOR_LIGHT_CYAN}DISABLE_MICRO${COLOR_RESET} - Disable building micro variants."
echo -e " ${COLOR_LIGHT_CYAN}ENABLE_MICRO${COLOR_RESET} - Enable building micro variants."
echo -e " ${COLOR_LIGHT_CYAN}CGO_ENABLED${COLOR_RESET} - Enable or disable CGO (default: ${DEFAULT_CGO_ENABLED})."
echo -e " ${COLOR_LIGHT_CYAN}FORCE_CGO${COLOR_RESET} - Force the use of CGO (default: ${DEFAULT_FORCE_CGO})."
echo -e " ${COLOR_LIGHT_CYAN}HOST_CC${COLOR_RESET} - Set the host C compiler (default: ${DEFAULT_CC})."
@ -94,7 +94,7 @@ function printHelp() {
echo -e " ${COLOR_LIGHT_BLUE}--bin-name=<name>${COLOR_RESET} - Specify the binary name (default: source directory basename)."
echo -e " ${COLOR_LIGHT_BLUE}--bin-name-no-suffix${COLOR_RESET} - Do not append the architecture suffix to the binary name."
echo -e " ${COLOR_LIGHT_BLUE}--more-go-cmd-args='<args>'${COLOR_RESET} - Pass additional arguments to the 'go build' command."
echo -e " ${COLOR_LIGHT_BLUE}--disable-micro${COLOR_RESET} - Disable building micro architecture variants."
echo -e " ${COLOR_LIGHT_BLUE}--enable-micro${COLOR_RESET} - Enable building micro architecture variants."
echo -e " ${COLOR_LIGHT_BLUE}--ldflags='<flags>'${COLOR_RESET} - Set linker flags (default: \"${DEFAULT_LDFLAGS}\")."
echo -e " ${COLOR_LIGHT_BLUE}--ext-ldflags='<flags>'${COLOR_RESET} - Set external linker flags (default: \"${DEFAULT_EXT_LDFLAGS}\")."
echo -e " ${COLOR_LIGHT_BLUE}-p=<platforms>, --platforms=<platforms>${COLOR_RESET} - Specify target platform(s) (default: host platform, supports: all, linux, linux/arm*, ...)."
@ -171,7 +171,7 @@ function fixArgs() {
setDefault "PLATFORMS" "${GOHOSTPLATFORM}"
setDefault "BUILD_MODE" "${DEFAULT_BUILD_MODE}"
setDefault "DISABLE_MICRO" ""
setDefault "ENABLE_MICRO" ""
setDefault "FORCE_CGO" "${DEFAULT_FORCE_CGO}"
setDefault "HOST_CC" "${DEFAULT_CC}"
setDefault "HOST_CXX" "${DEFAULT_CXX}"
@ -794,7 +794,7 @@ function buildTarget() {
buildTargetWithMicro "${goos}" "${goarch}" ""
if [ -n "${DISABLE_MICRO}" ]; then
if [ -z "${ENABLE_MICRO}" ]; then
return 0
fi
@ -917,7 +917,7 @@ function buildTargetWithMicro() {
[ -z "$micro" ] && micro="6"
;;
"arm64")
build_env+=("GOARM=${micro}")
build_env+=("GOARM64=${micro}")
[ -z "$micro" ] && micro="v8.0"
;;
"amd64")
@ -1085,8 +1085,8 @@ while [[ $# -gt 0 ]]; do
--more-go-cmd-args=*)
addBuildArgs "${1#*=}"
;;
--disable-micro)
DISABLE_MICRO="true"
--enable-micro)
ENABLE_MICRO="true"
;;
--ldflags=*)
addLDFLAGS "${1#*=}"