From d0bb03cd1e746309ace7798f076617f03b8092db Mon Sep 17 00:00:00 2001 From: Nite07 Date: Wed, 17 Apr 2024 21:27:40 +0800 Subject: [PATCH] mod workflow --- .github/workflows/docker-dev.yaml | 51 --------------------------- .github/workflows/docker.yaml | 49 ------------------------- .github/workflows/goreleaser-pre.yaml | 31 ---------------- .github/workflows/goreleaser.yaml | 31 ---------------- .goreleaser.pre.yaml | 6 +--- .goreleaser.yaml | 4 --- .woodspecker/docker-nightly.yml | 10 ++++++ .woodspecker/docker.yml | 13 +++++++ .woodspecker/release.yml | 18 ++++++++++ 9 files changed, 42 insertions(+), 171 deletions(-) delete mode 100644 .github/workflows/docker-dev.yaml delete mode 100644 .github/workflows/docker.yaml delete mode 100644 .github/workflows/goreleaser-pre.yaml delete mode 100644 .github/workflows/goreleaser.yaml create mode 100644 .woodspecker/docker-nightly.yml create mode 100644 .woodspecker/docker.yml create mode 100644 .woodspecker/release.yml diff --git a/.github/workflows/docker-dev.yaml b/.github/workflows/docker-dev.yaml deleted file mode 100644 index 14c5abc..0000000 --- a/.github/workflows/docker-dev.yaml +++ /dev/null @@ -1,51 +0,0 @@ -name: Build and Push Docker(Dev) - -on: - push: - tags: - - "v[0-9].[0-9].[0-9]-beta*" - workflow_dispatch: - -jobs: - build-and-push: - runs-on: ubuntu-latest - - steps: - - name: Check out code - uses: actions/checkout@v3 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_PASSWORD }} - - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: | - ${{ secrets.DOCKER_HUB_USERNAME }}/sub2sing-box - ghcr.io/${{ github.repository }} - tags: dev - - - name: Set up Docker buildx - uses: docker/setup-buildx-action@v3 - - - name: Build and push Docker image to GHCR and Docker Hub - uses: docker/build-push-action@v5 - with: - context: . - file: ./Dockerfile - build-args: version=${{ github.sha }} - push: true - platforms: linux/amd64,linux/arm,linux/arm64 - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml deleted file mode 100644 index 15a0250..0000000 --- a/.github/workflows/docker.yaml +++ /dev/null @@ -1,49 +0,0 @@ -name: Build and Push Docker - -on: - push: - tags: - - "v[0-9].[0-9].[0-9]" - -jobs: - build-and-push: - runs-on: ubuntu-latest - - steps: - - name: Check out code - uses: actions/checkout@v3 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_PASSWORD }} - - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: | - ${{ secrets.DOCKER_HUB_USERNAME }}/sub2sing-box - ghcr.io/${{ github.repository }} - - - name: Set up Docker buildx - uses: docker/setup-buildx-action@v3 - - - name: Build and push Docker image to GHCR and Docker Hub - uses: docker/build-push-action@v5 - with: - context: . - file: ./Dockerfile - build-args: version=${{ github.ref_name }} - push: true - platforms: linux/amd64,linux/arm,linux/arm64 - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/goreleaser-pre.yaml b/.github/workflows/goreleaser-pre.yaml deleted file mode 100644 index 1317b21..0000000 --- a/.github/workflows/goreleaser-pre.yaml +++ /dev/null @@ -1,31 +0,0 @@ -name: Build and Release(Beta) - -on: - push: - tags: - - "v[0-9].[0-9].[0-9]-beta*" - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - permissions: - contents: write - packages: write - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version: 1.21.5 - - - name: Run goreleaser - uses: goreleaser/goreleaser-action@v5 - with: - distribution: goreleaser - version: latest - args: release --clean -f .goreleaser.pre.yaml - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/goreleaser.yaml b/.github/workflows/goreleaser.yaml deleted file mode 100644 index 42d731a..0000000 --- a/.github/workflows/goreleaser.yaml +++ /dev/null @@ -1,31 +0,0 @@ -name: Build and Release - -on: - push: - tags: - - "v[0-9].[0-9].[0-9]" - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - permissions: - contents: write - packages: write - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version: 1.21.5 - - - name: Run goreleaser - uses: goreleaser/goreleaser-action@v5 - with: - distribution: goreleaser - version: latest - args: release --clean - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.pre.yaml b/.goreleaser.pre.yaml index 976e761..682c7ec 100644 --- a/.goreleaser.pre.yaml +++ b/.goreleaser.pre.yaml @@ -27,8 +27,4 @@ archives: - README.md - templates release: - prerelease: auto - draft: true - github: - owner: nitezs - name: sub2sing-box + prerelease: true diff --git a/.goreleaser.yaml b/.goreleaser.yaml index e18e55d..2aea47c 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -26,7 +26,3 @@ archives: - LICENSE - README.md - templates -release: - github: - owner: nitezs - name: sub2sing-box diff --git a/.woodspecker/docker-nightly.yml b/.woodspecker/docker-nightly.yml new file mode 100644 index 0000000..bb7ab89 --- /dev/null +++ b/.woodspecker/docker-nightly.yml @@ -0,0 +1,10 @@ +steps: + - name: build + image: woodpeckerci/plugin-docker-buildx + settings: + platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/386,linux/ppc64le,linux/s390x + repo: nite07/sub2sing-box + tag: nightly + username: nite07 + password: + from_secret: docker_password diff --git a/.woodspecker/docker.yml b/.woodspecker/docker.yml new file mode 100644 index 0000000..bcbc00c --- /dev/null +++ b/.woodspecker/docker.yml @@ -0,0 +1,13 @@ +when: + event: tag + +steps: + - name: build + image: woodpeckerci/plugin-docker-buildx + settings: + platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/386,linux/ppc64le,linux/s390x + repo: nite07/sub2sing-box + tag: ${CI_COMMIT_TAG} + username: nite07 + password: + from_secret: docker_password diff --git a/.woodspecker/release.yml b/.woodspecker/release.yml new file mode 100644 index 0000000..bd3b3e1 --- /dev/null +++ b/.woodspecker/release.yml @@ -0,0 +1,18 @@ +when: + event: tag + +steps: + - name: build + image: goreleaser/goreleaser:latest + commands: + - goreleaser release --clean --skip publish + - mkdir release + - mv dist/*.tar.gz release/ + - mv dist/*.zip release/ + - name: release + image: woodpeckerci/plugin-gitea-release + settings: + files: release/* + api_key: + from_secret: gitea_key + base-url: https://git.nite07.com