diff --git a/.github/workflows/build-publish-to-oss.yml b/.github/workflows/build-publish-to-oss.yml index 712d0c335..19030284b 100644 --- a/.github/workflows/build-publish-to-oss.yml +++ b/.github/workflows/build-publish-to-oss.yml @@ -44,4 +44,4 @@ jobs: access-key-secret: ${{ secrets.OSS_ACCESS_KEY_SECRET }} ossutil-version: '1.7.18' - name: Upload Assets to OSS - run: ossutil cp -r dist/ oss://resource-fit2cloud-com/1panel/package/stable/${{ github.ref_name }}/release/ --include "*.tar.gz" --include "checksums.txt" --only-current-dir --force \ No newline at end of file + run: ossutil cp -r dist/ oss://resource-fit2cloud-com/1panel/package/v2/stable/${{ github.ref_name }}/release/ --include "*.tar.gz" --include "checksums.txt" --only-current-dir --force diff --git a/.github/workflows/build-publish-to-r2.yml b/.github/workflows/build-publish-to-r2.yml index 5f5331205..0fa7959a7 100644 --- a/.github/workflows/build-publish-to-r2.yml +++ b/.github/workflows/build-publish-to-r2.yml @@ -42,4 +42,4 @@ jobs: rclone_config: ${{ secrets.RCLONE_CONFIG }} - name: Upload to Cloudflare R2 run: | - rclone copy dist/ cloudflare_r2:package/stable/${{ github.ref_name }}/release/ --include "*.tar.gz" --include "checksums.txt" --progress \ No newline at end of file + rclone copy dist/ cloudflare_r2:package/v2/stable/${{ github.ref_name }}/release/ --include "*.tar.gz" --include "checksums.txt" --progress diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 9e45e8616..f2fea0f97 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -9,11 +9,34 @@ before: - chmod +x ./ci/script.sh - ./ci/script.sh - sed -i 's@ORIGINAL_VERSION=.*@ORIGINAL_VERSION=v{{ .Version }}@g' 1pctl - - go mod tidy + - cd ./core && go mod tidy + - cd ./agent && go mod tidy builds: - - main: ./cmd/server/main.go - binary: 1panel + - id: agent + main: ./agent/cmd/server/main.go + binary: 1panel-agent + flags: + - -tags=xpack + - -trimpath + ldflags: + - -w -s + env: + - CGO_ENABLED=0 + goos: + - linux + goarm: + - 7 + goarch: + - amd64 + - arm64 + - arm + - ppc64le + - s390x + + - id: core + main: ./core/cmd/server/main.go + binary: 1panel-core flags: - -tags=xpack - -trimpath @@ -34,11 +57,15 @@ builds: archives: - format: tar.gz + builds: + - core + - agent name_template: "1panel-v{{ .Version }}-{{ .Os }}-{{ .Arch }}{{- if .Arm }}v{{ .Arm }}{{ end }}" wrap_in_directory: true files: - 1pctl - - 1panel.service + - 1panel-core.service + - 1panel-agent.service - install.sh - GeoIP.mmdb - lang/* diff --git a/ci/script.sh b/ci/script.sh index 6a5fa71b5..eae3a0f8d 100755 --- a/ci/script.sh +++ b/ci/script.sh @@ -6,15 +6,19 @@ command -v wget >/dev/null || { } if [ ! -f "1pctl" ]; then - wget https://github.com/1Panel-dev/installer/raw/main/1pctl -fi - -if [ ! -f "1panel.service" ]; then - wget https://github.com/1Panel-dev/installer/raw/main/1panel.service + wget https://github.com/1Panel-dev/installer/raw/v2/1pctl fi if [ ! -f "install.sh" ]; then - wget https://github.com/1Panel-dev/installer/raw/main/install.sh + wget https://github.com/1Panel-dev/installer/raw/v2/install.sh +fi + +if [ ! -f "1panel-core.service" ]; then + wget https://github.com/1Panel-dev/installer/raw/v2/1panel-core.service +fi + +if [ ! -f "1panel-agent.service" ]; then + wget https://github.com/1Panel-dev/installer/raw/v2/1panel-agent.service fi if [ ! -f "GeoIP.mmdb" ]; then