From 960942a2d3ebde09d4f4b768ac5e0e7c5ec0b9e8 Mon Sep 17 00:00:00 2001 From: Nite07 Date: Tue, 23 Apr 2024 17:28:10 +0800 Subject: [PATCH] :wrench: Update workflows --- .goreleaser.pre.yaml | 30 ------------------------------ .woodpecker/docker-nightly.yml | 14 -------------- .woodpecker/docker.yml | 14 +++++++++++--- .woodpecker/release.yml | 8 +++++--- 4 files changed, 16 insertions(+), 50 deletions(-) delete mode 100644 .goreleaser.pre.yaml delete mode 100644 .woodpecker/docker-nightly.yml diff --git a/.goreleaser.pre.yaml b/.goreleaser.pre.yaml deleted file mode 100644 index 661278e..0000000 --- a/.goreleaser.pre.yaml +++ /dev/null @@ -1,30 +0,0 @@ -project_name: sub2sing-box -builds: - - env: - - CGO_ENABLED=0 - goos: - - windows - - linux - - darwin - goarch: - - amd64 - - arm64 - - arm - - "386" - ldflags: - - -s -w -X sub2sing-box/constant.Version={{ .Version }} - flags: - - -trimpath - no_unique_dist_dir: true -archives: - - format: tar.gz - format_overrides: - - format: zip - goos: windows - wrap_in_directory: true - files: - - LICENSE - - README.md - - templates -release: - prerelease: true diff --git a/.woodpecker/docker-nightly.yml b/.woodpecker/docker-nightly.yml deleted file mode 100644 index 5c39913..0000000 --- a/.woodpecker/docker-nightly.yml +++ /dev/null @@ -1,14 +0,0 @@ -when: - - event: cron - cron: docker-nightly - -steps: - - name: build - image: woodpeckerci/plugin-docker-buildx - settings: - platforms: linux/amd64,linux/arm64,linux/arm/v7 - repo: nite07/sub2sing-box - tag: nightly - username: nite07 - password: - from_secret: docker_password diff --git a/.woodpecker/docker.yml b/.woodpecker/docker.yml index 0343bd0..d932f24 100644 --- a/.woodpecker/docker.yml +++ b/.woodpecker/docker.yml @@ -1,13 +1,21 @@ when: - event: tag + - event: tag + ref: refs/tags/v* steps: + - name: prepare-tags + image: bash + commands: + - | + echo "${CI_COMMIT_TAG##v}" > .tags + if ! echo "${CI_COMMIT_TAG}" | grep -Eq "beta|alpha"; then + echo "latest" > .tags + fi - name: build image: woodpeckerci/plugin-docker-buildx settings: - platforms: linux/amd64,linux/arm64,linux/arm/v7 + platforms: linux/amd64 repo: nite07/sub2sing-box - auto_tag: true username: nite07 password: from_secret: docker_password diff --git a/.woodpecker/release.yml b/.woodpecker/release.yml index bd3b3e1..23878ba 100644 --- a/.woodpecker/release.yml +++ b/.woodpecker/release.yml @@ -1,6 +1,7 @@ when: - event: tag - + - event: tag + ref: refs/tags/v* + steps: - name: build image: goreleaser/goreleaser:latest @@ -14,5 +15,6 @@ steps: settings: files: release/* api_key: - from_secret: gitea_key + from_secret: forgejo_token base-url: https://git.nite07.com + draft: true