diff --git a/.github/workflows/build.yaml b/.github/workflows/build-test.yml similarity index 73% rename from .github/workflows/build.yaml rename to .github/workflows/build-test.yml index 7cf0b6ca..ab8a56df 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build-test.yml @@ -1,13 +1,12 @@ -name: Build +name: 🙏🏻 Build Test on: push: - branches: - - master pull_request: + workflow_dispatch: jobs: lint: - name: golangci-lint + name: Lint Test runs-on: ubuntu-latest steps: - name: Checkout code @@ -15,13 +14,12 @@ jobs: - name: Run golangci-lint uses: golangci/golangci-lint-action@v2 with: - # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. version: latest args: --timeout 5m working-directory: v2/ build: - name: Build + name: Test Builds runs-on: ubuntu-latest steps: - name: Set up Go @@ -42,4 +40,4 @@ jobs: - name: Build run: go build . - working-directory: v2/cmd/nuclei/ + working-directory: v2/cmd/nuclei/ \ No newline at end of file diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 00000000..27695f3d --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,36 @@ +name: 🚨 CodeQL Analysis + +on: + workflow_dispatch: + pull_request: + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'go' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 \ No newline at end of file diff --git a/.github/workflows/dockerhub-push.yml b/.github/workflows/dockerhub-push.yml index 1e235e7a..f201dc1b 100644 --- a/.github/workflows/dockerhub-push.yml +++ b/.github/workflows/dockerhub-push.yml @@ -1,17 +1,34 @@ -name: ◎ Docker Push +name: 🌥 Docker Push + on: + release: + types: [published] workflow_dispatch: jobs: - update: + docker: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Publish to Dockerhub Registry - uses: dawidd6/action-docker-publish-changed@v3 - with: - name: projectdiscovery/nuclei - username: ${{secrets.DOCKER_USERNAME}} - password: ${{secrets.DOCKER_PASSWORD}} - platforms: linux/amd64,linux/arm64,linux/arm - tag: latest \ No newline at end of file + - + name: Checkout + uses: actions/checkout@v2 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + platforms: linux/amd64,linux/arm64,linux/arm + push: true + tags: projectdiscovery/nuclei:latest \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release-binary.yml similarity index 84% rename from .github/workflows/release.yml rename to .github/workflows/release-binary.yml index 82299412..7bc3cc13 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release-binary.yml @@ -1,8 +1,9 @@ -name: Release +name: 🎉 Release Binary on: create: tags: - v* + workflow_dispatch: jobs: release: @@ -17,7 +18,7 @@ jobs: name: "Set up Go" uses: actions/setup-go@v2 with: - go-version: 1.15 + go-version: 1.16 - env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" @@ -26,5 +27,4 @@ jobs: with: args: "release --rm-dist" version: latest - workdir: v2/ - \ No newline at end of file + workdir: v2/ \ No newline at end of file diff --git a/v2/.goreleaser.yml b/v2/.goreleaser.yml index f88edccd..48ca17be 100644 --- a/v2/.goreleaser.yml +++ b/v2/.goreleaser.yml @@ -3,23 +3,29 @@ before: - go mod tidy builds: - - binary: nuclei - main: cmd/nuclei/main.go - goos: - - linux - - windows - - darwin - goarch: - - amd64 - - 386 - - arm - - arm64 - +- env: + - CGO_ENABLED=0 + goos: + - windows + - linux + - darwin + goarch: + - amd64 + - 386 + - arm + - arm64 + + ignore: + - goos: darwin + goarch: '386' + + binary: '{{ .ProjectName }}' + main: cmd/nuclei/main.go + archives: - - id: tgz - format: tar.gz - replacements: - darwin: macOS - format_overrides: - - goos: windows - format: zip +- format: zip + replacements: + darwin: macOS + +checksum: + algorithm: sha256 \ No newline at end of file