From 3b60436ab8b3cace0a0ff59f80a2d7e052cc5104 Mon Sep 17 00:00:00 2001 From: d3m0k1d Date: Wed, 14 Jan 2026 00:56:13 +0300 Subject: [PATCH] fix: ci one more time --- .gitea/workflows/CD.yml | 73 +++++++++++------------------------------ 1 file changed, 19 insertions(+), 54 deletions(-) diff --git a/.gitea/workflows/CD.yml b/.gitea/workflows/CD.yml index 4eba6f7..f00b628 100644 --- a/.gitea/workflows/CD.yml +++ b/.gitea/workflows/CD.yml @@ -32,11 +32,6 @@ jobs: - run: go mod tidy - - uses: golangci/golangci-lint-action@v9.2.0 - with: - args: --timeout=5m - skip-cache: true - - run: go test ./... - name: Build ${{ matrix.goos }}-${{ matrix.arch }} @@ -45,60 +40,30 @@ jobs: GOARCH: ${{ matrix.arch }} run: go build -o banforge-${{ matrix.goos }}-${{ matrix.arch }} ./cmd/banforge - - uses: actions/upload-artifact@v2 - with: - name: banforge-${{ matrix.arch }} - path: banforge-${{ matrix.goos }}-${{ matrix.arch }} - retention-days: 1 - - release: - needs: build - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v6 - - - uses: actions/download-artifact@v2 - with: - path: ./artifacts - - - name: Create Release + - name: Upload to release env: - GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} + TOKEN: ${{ secrets.TOKEN }} run: | TAG="${{ gitea.ref_name }}" REPO="${{ gitea.repository }}" SERVER="${{ gitea.server_url }}" - TOKEN="$TOKEN" + + if [ "${{ matrix.arch }}" = "amd64" ]; then + curl -X POST \ + -H "Authorization: token $TOKEN" \ + -H "Content-Type: application/json" \ + -d '{ + "tag_name": "'$TAG'", + "name": "Release '$TAG'", + "body": "# BanForge '$TAG'\n\nIntrusion Prevention System", + "draft": false, + "prerelease": false + }' \ + "$SERVER/api/v1/repos/$REPO/releases" 2>/dev/null || true + fi curl -X POST \ -H "Authorization: token $TOKEN" \ - -H "Content-Type: application/json" \ - -d '{ - "tag_name": "'$TAG'", - "name": "Release '$TAG'", - "body": "# BanForge '$TAG'\n\nIntrusion Prevention System\n\n## Supported Firewalls\n- UFW\n- iptables\n- nftables\n- firewalld", - "draft": false, - "prerelease": false - }' \ - "$SERVER/api/v1/repos/$REPO/releases" - - - name: Upload Assets - env: - GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} - run: | - TAG="${{ gitea.ref_name }}" - REPO="${{ gitea.repository }}" - SERVER="${{ gitea.server_url }}" - TOKEN="$GITEA_TOKEN" - - for artifact_dir in artifacts/*/; do - for file in "$artifact_dir"*; do - [ -f "$file" ] && \ - curl -X POST \ - -H "Authorization: token $TOKEN" \ - -H "Content-Type: application/octet-stream" \ - --data-binary "@$file" \ - "$SERVER/api/v1/repos/$REPO/releases/tags/$TAG/assets?name=$(basename "$file")" - done - done + -H "Content-Type: application/octet-stream" \ + --data-binary "@banforge-${{ matrix.goos }}-${{ matrix.arch }}" \ + "$SERVER/api/v1/repos/$REPO/releases/tags/$TAG/assets?name=banforge-${{ matrix.goos }}-${{ matrix.arch }}"