From a5257be319839ee269ac97ee95b76a804f2e3155 Mon Sep 17 00:00:00 2001 From: ryan Date: Fri, 5 Jun 2026 11:28:02 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BC=98=E5=8C=96]=20=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/release.yml | 122 ----------------------------------- 1 file changed, 122 deletions(-) delete mode 100644 .gitea/workflows/release.yml diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml deleted file mode 100644 index d8595516..00000000 --- a/.gitea/workflows/release.yml +++ /dev/null @@ -1,122 +0,0 @@ -name: Release - -on: - workflow_dispatch: - push: - tags: ["v*"] - -jobs: - release: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: https://github.com/actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Resolve version metadata - id: version - shell: bash - run: | - SHOULD_RUN=true - POINTED_TAG="$(git tag --points-at HEAD --list 'v*' | sort -V | tail -n1)" - - if [[ "${GITHUB_REF}" == refs/heads/main ]] && [[ -n "$POINTED_TAG" ]]; then - SHOULD_RUN=false - VERSION="$POINTED_TAG" - elif [[ "${GITHUB_REF}" == refs/tags/* ]]; then - VERSION="${GITHUB_REF_NAME}" - else - VERSION="$(git describe --tags)" - fi - - echo "should_run=$SHOULD_RUN" >> "$GITHUB_OUTPUT" - echo "version=$VERSION" >> "$GITHUB_OUTPUT" - if [[ "$VERSION" =~ ^v[0-9]+(\.[0-9]+)*$ ]]; then - echo "is_prerelease=false" >> "$GITHUB_OUTPUT" - else - echo "is_prerelease=true" >> "$GITHUB_OUTPUT" - fi - - - name: Set up Node.js - if: steps.version.outputs.should_run == 'true' - uses: https://github.com/actions/setup-node@v4 - with: - node-version: 20 - - - name: Build Frontend - if: steps.version.outputs.should_run == 'true' - env: - CI: "" - VERSION: ${{ steps.version.outputs.version }} - run: | - cd openflare_server/web - corepack enable - pnpm install --frozen-lockfile - NEXT_PUBLIC_APP_VERSION="$VERSION" pnpm build - - - name: Set up Go - if: steps.version.outputs.should_run == 'true' - uses: https://github.com/actions/setup-go@v5 - with: - go-version-file: openflare_server/go.mod - - - name: Build Server Binaries - if: steps.version.outputs.should_run == 'true' - shell: bash - env: - CGO_ENABLED: 0 - VERSION: ${{ steps.version.outputs.version }} - run: | - set -euo pipefail - - mkdir -p dist - - cd openflare_server - go mod download - - while read -r GOOS GOARCH ASSET_NAME; do - GOOS="$GOOS" GOARCH="$GOARCH" \ - go build -trimpath -ldflags "-s -w -X 'openflare/common.Version=$VERSION'" -o "../dist/$ASSET_NAME" . - done <<'EOF' - linux amd64 openflare-server-linux-amd64 - linux arm64 openflare-server-linux-arm64 - darwin amd64 openflare-server-darwin-amd64 - darwin arm64 openflare-server-darwin-arm64 - windows amd64 openflare-server-windows-amd64.exe - EOF - - - name: Build Agent Binaries - if: steps.version.outputs.should_run == 'true' - shell: bash - env: - CGO_ENABLED: 0 - VERSION: ${{ steps.version.outputs.version }} - run: | - set -euo pipefail - - cd openflare_agent - go mod download - - while read -r GOOS GOARCH ASSET_NAME; do - GOOS="$GOOS" GOARCH="$GOARCH" \ - go build -trimpath -ldflags "-s -w -X 'openflare-agent/internal/config.Version=$VERSION'" -o "../dist/$ASSET_NAME" ./cmd/agent - done <<'EOF' - linux amd64 openflare-agent-linux-amd64 - linux arm64 openflare-agent-linux-arm64 - darwin amd64 openflare-agent-darwin-amd64 - darwin arm64 openflare-agent-darwin-arm64 - windows amd64 openflare-agent-windows-amd64.exe - EOF - - - name: Publish Release - if: steps.version.outputs.should_run == 'true' - uses: https://gitea.com/actions/gitea-release-action@v1 - with: - tag_name: ${{ steps.version.outputs.version }} - name: ${{ steps.version.outputs.version }} - target_commitish: ${{ github.sha }} - files: | - dist/* - draft: false - prerelease: ${{ steps.version.outputs.is_prerelease == 'true' }}