fix: Update module path to /v3 for proper Go module versioning #14
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| permissions: | |
| contents: write | |
| packages: write | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version tag (e.g., v3.3.0)' | |
| required: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| fetch-depth: 0 | |
| - name: Update submodules (with error handling) | |
| run: | | |
| git submodule sync --recursive || true | |
| git submodule update --init --recursive --force || echo "Warning: Some submodules failed to update" | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.24' | |
| cache-dependency-path: go.sum | |
| - name: Verify Go version | |
| run: go version | |
| - name: Build AutoAR binary | |
| run: | | |
| CGO_ENABLED=1 go build -o autoar ./cmd/autoar | |
| chmod +x autoar | |
| - name: Test build | |
| run: | | |
| ./autoar --help || true | |
| - name: Gitleaks scan | |
| uses: gitleaks/gitleaks-action@v2 | |
| with: | |
| config-path: .gitleaks.toml | |
| - name: Create release archive | |
| run: | | |
| VERSION=${GITHUB_REF_NAME#v} | |
| if [ -z "$VERSION" ]; then | |
| VERSION=${{ github.event.inputs.version }} | |
| fi | |
| # Create release directory | |
| mkdir -p release | |
| # Copy binary | |
| cp autoar release/ | |
| # Copy essential directories | |
| cp -r nuclei_templates/ release/ || true | |
| cp -r Wordlists/ release/ || true | |
| cp -r regexes/ release/ | |
| cp -r templates/ release/ || true | |
| # Copy configuration files | |
| cp env.example release/ | |
| cp docker-compose.yml release/ | |
| cp Dockerfile release/ | |
| cp README.md release/ | |
| cp go.mod go.sum release/ | |
| # Create archives | |
| tar -czf autoar-${GITHUB_REF_NAME}-linux-amd64.tar.gz -C release . | |
| zip -r autoar-${GITHUB_REF_NAME}-linux-amd64.zip release/ | |
| - name: Upload release assets | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| autoar-*.tar.gz | |
| autoar-*.zip | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| docker: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| fetch-depth: 0 | |
| - name: Update submodules (with error handling) | |
| run: | | |
| git submodule sync --recursive || true | |
| git submodule update --init --recursive --force || echo "Warning: Some submodules failed to update" | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ghcr.io/${{ github.repository_owner }}/autoar | |
| tags: | | |
| type=ref,event=tag | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=semver,pattern={{major}} | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: Dockerfile | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| platforms: linux/amd64,linux/arm64 |