diff --git a/.github/workflows/build-publish-to-oss.yml b/.github/workflows/build-publish-to-oss.yml index 8ff0b7664..5cba5113b 100644 --- a/.github/workflows/build-publish-to-oss.yml +++ b/.github/workflows/build-publish-to-oss.yml @@ -21,7 +21,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: '1.23' + go-version: '1.24' - name: Build Release uses: goreleaser/goreleaser-action@v6 with: diff --git a/.github/workflows/build-publish-to-r2.yml b/.github/workflows/build-publish-to-r2.yml index 17674d765..0f624c552 100644 --- a/.github/workflows/build-publish-to-r2.yml +++ b/.github/workflows/build-publish-to-r2.yml @@ -21,7 +21,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: '1.23' + go-version: '1.24' - name: Build Release uses: goreleaser/goreleaser-action@v6 with: diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 250dbd02f..3ef2ce76a 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -33,9 +33,6 @@ builds: - ppc64le - s390x - riscv64 - hooks: - post: - - ./ci/script.sh compress_binary {{ .Path }} {{ .Arch }} - id: core dir: core @@ -59,9 +56,6 @@ builds: - ppc64le - s390x - riscv64 - hooks: - post: - - ./ci/script.sh compress_binary {{ .Path }} {{ .Arch }} archives: - formats: [ 'tar.gz' ] diff --git a/ci/script.sh b/ci/script.sh index 7c5a87bfd..556002a65 100755 --- a/ci/script.sh +++ b/ci/script.sh @@ -2,72 +2,39 @@ set -e -download_resources() { - command -v wget >/dev/null || { - echo "wget not found, please install it and try again." - exit 1 - } - - if [ ! -f "1pctl" ]; then - wget https://github.com/1Panel-dev/installer/raw/v2/1pctl - fi - - if [ ! -f "install.sh" ]; then - wget https://github.com/1Panel-dev/installer/raw/v2/install.sh - fi - - if [ ! -d "initscript" ]; then - wget https://github.com/1Panel-dev/installer/raw/v2/initscript/1panel-core.service - wget https://github.com/1Panel-dev/installer/raw/v2/initscript/1panel-agent.service - mkdir -p initscript && cd initscript - for file in 1panel-core.init 1panel-agent.init 1panel-core.openrc 1panel-agent.openrc 1panel-core.procd 1panel-agent.procd 1panel-core.service 1panel-agent.service; do - wget -q https://github.com/1Panel-dev/installer/raw/v2/initscript/$file - done - cd .. - fi - - if [ ! -d "lang" ]; then - mkdir -p lang && cd lang - for lang in en fa pt-BR ru zh; do - wget -q https://github.com/1Panel-dev/installer/raw/v2/lang/$lang.sh - done - cd .. - fi - - if [ ! -f "GeoIP.mmdb" ]; then - wget https://resource.fit2cloud.com/1panel/package/v2/geo/GeoIP.mmdb - fi - - chmod 755 1pctl install.sh +command -v wget >/dev/null || { + echo "wget not found, please install it and try again." + exit 1 } -compress_binary() { - local binary_path="$1" - local arch="$2" +if [ ! -f "1pctl" ]; then + wget https://github.com/1Panel-dev/installer/raw/v2/1pctl +fi - echo "Attempting to compress: $binary_path for arch: $arch" +if [ ! -f "install.sh" ]; then + wget https://github.com/1Panel-dev/installer/raw/v2/install.sh +fi - if [ "$arch" = "s390x" ]; then - echo "Skipping UPX compression for s390x" - return - fi +if [ ! -d "initscript" ]; then + wget https://github.com/1Panel-dev/installer/raw/v2/initscript/1panel-core.service + wget https://github.com/1Panel-dev/installer/raw/v2/initscript/1panel-agent.service + mkdir -p initscript && cd initscript + for file in 1panel-core.init 1panel-agent.init 1panel-core.openrc 1panel-agent.openrc 1panel-core.procd 1panel-agent.procd 1panel-core.service 1panel-agent.service; do + wget -q https://github.com/1Panel-dev/installer/raw/v2/initscript/$file + done + cd .. +fi - if ! command -v upx >/dev/null; then - echo "Installing upx..." - if [ "$(uname -m)" = "s390x" ]; then - echo "UPX not supported on s390x" - return - fi +if [ ! -d "lang" ]; then + mkdir -p lang && cd lang + for lang in en fa pt-BR ru zh; do + wget -q https://github.com/1Panel-dev/installer/raw/v2/lang/$lang.sh + done + cd .. +fi - sudo apt-get update - sudo apt-get install -y upx-ucl - fi +if [ ! -f "GeoIP.mmdb" ]; then + wget https://resource.fit2cloud.com/1panel/package/v2/geo/GeoIP.mmdb +fi - upx --best --lzma "$binary_path" && echo "[ok] Compressed: $binary_path" || echo "[warn] Failed to compress: $binary_path" -} - -if [ "$1" = "compress_binary" ]; then - compress_binary "$2" "$3" -else - download_resources -fi \ No newline at end of file +chmod 755 1pctl install.sh