From de42e7532c86369c855e34adb4592a3956f5e320 Mon Sep 17 00:00:00 2001 From: sandeep <8293321+ehsandeep@users.noreply.github.com> Date: Sun, 26 Feb 2023 16:03:27 +0530 Subject: [PATCH 1/2] docker workflow fix --- Dockerfile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 45c18713..9103f6c9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,15 @@ # Base FROM golang:1.20.1-alpine AS builder -RUN apk add --no-cache git -RUN go install -v github.com/projectdiscovery/proxify/cmd/proxify@latest +RUN apk add --no-cache git build-base +WORKDIR /app +COPY . /app +RUN go mod download +RUN go build ./cmd/proxify FROM alpine:3.17.2 RUN apk -U upgrade --no-cache \ && apk add --no-cache bind-tools ca-certificates -COPY --from=builder /go/bin/proxify /usr/local/bin/ +COPY --from=builder /app/proxify /usr/local/bin/ ENTRYPOINT ["proxify"] From 675d38343ad098dd4998cbdefc516bffb9609491 Mon Sep 17 00:00:00 2001 From: sandeep <8293321+ehsandeep@users.noreply.github.com> Date: Sun, 26 Feb 2023 16:16:22 +0530 Subject: [PATCH 2/2] more workflow fixes --- .github/dependabot.yml | 6 ++--- .github/workflows/build-test.yml | 4 +-- .github/workflows/dockerhub-push.yml | 4 +-- .github/workflows/lint-test.yml | 2 +- .github/workflows/release-binary.yml | 8 +++--- .github/workflows/sonarcloud.yml | 38 ---------------------------- .goreleaser.yml | 6 ++++- 7 files changed, 18 insertions(+), 50 deletions(-) delete mode 100644 .github/workflows/sonarcloud.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index a0820a1f..52749352 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -10,7 +10,7 @@ updates: - package-ecosystem: "github-actions" directory: "/" schedule: - interval: "daily" + interval: "weekly" target-branch: "dev" commit-message: prefix: "chore" @@ -22,7 +22,7 @@ updates: - package-ecosystem: "gomod" directory: "/" schedule: - interval: "daily" + interval: "weekly" target-branch: "dev" commit-message: prefix: "chore" @@ -34,7 +34,7 @@ updates: - package-ecosystem: "docker" directory: "/" schedule: - interval: "daily" + interval: "weekly" target-branch: "dev" commit-message: prefix: "chore" diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index f3fc9daa..b4d7d26b 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -11,12 +11,12 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, windows-latest, macOS-latest] + os: [ubuntu-latest-16-cores, windows-latest-8-cores, macOS-latest] steps: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: 1.19 - name: Check out code uses: actions/checkout@v3 diff --git a/.github/workflows/dockerhub-push.yml b/.github/workflows/dockerhub-push.yml index c589f4c1..e8c77409 100644 --- a/.github/workflows/dockerhub-push.yml +++ b/.github/workflows/dockerhub-push.yml @@ -17,7 +17,7 @@ jobs: - name: Get Github tag id: meta run: | - echo "::set-output name=tag::$(curl --silent "https://api.github.com/repos/projectdiscovery/proxify/releases/latest" | jq -r .tag_name)" + curl --silent "https://api.github.com/repos/projectdiscovery/proxify/releases/latest" | jq -r .tag_name | xargs -I {} echo TAG={} >> $GITHUB_OUTPUT - name: Set up QEMU uses: docker/setup-qemu-action@v2 @@ -37,4 +37,4 @@ jobs: context: . platforms: linux/amd64,linux/arm64,linux/arm push: true - tags: projectdiscovery/proxify:latest,projectdiscovery/proxify:${{ steps.meta.outputs.tag }} \ No newline at end of file + tags: projectdiscovery/proxify:latest,projectdiscovery/proxify:${{ steps.meta.outputs.TAG }} \ No newline at end of file diff --git a/.github/workflows/lint-test.yml b/.github/workflows/lint-test.yml index 21c5b533..e0bc3b49 100644 --- a/.github/workflows/lint-test.yml +++ b/.github/workflows/lint-test.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: 1.19 - name: Run golangci-lint uses: golangci/golangci-lint-action@v3.4.0 diff --git a/.github/workflows/release-binary.yml b/.github/workflows/release-binary.yml index c4408a33..54b5575b 100644 --- a/.github/workflows/release-binary.yml +++ b/.github/workflows/release-binary.yml @@ -1,14 +1,14 @@ name: 🎉 Release Binary on: - create: + push: tags: - v* workflow_dispatch: jobs: release: - runs-on: ubuntu-latest + runs-on: ubuntu-latest-16-cores steps: - name: "Check out code" uses: actions/checkout@v3 @@ -18,7 +18,7 @@ jobs: - name: "Set up Go" uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: 1.19 - name: "Create release on GitHub" uses: goreleaser/goreleaser-action@v4 @@ -29,3 +29,5 @@ jobs: env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" SLACK_WEBHOOK: "${{ secrets.RELEASE_SLACK_WEBHOOK }}" + DISCORD_WEBHOOK_ID: "${{ secrets.DISCORD_WEBHOOK_ID }}" + DISCORD_WEBHOOK_TOKEN: "${{ secrets.DISCORD_WEBHOOK_TOKEN }}" diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml deleted file mode 100644 index 20e7e48f..00000000 --- a/.github/workflows/sonarcloud.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: 👮🏼‍♂️ Sonarcloud -on: - push: - branches: - - master - - dev - pull_request: - types: [opened, synchronize, reopened] - workflow_dispatch: - -jobs: - sonarcloud: - name: SonarCloud - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - - name: "Set up Go" - uses: actions/setup-go@v3 - with: - go-version: 1.18 - - - name: Run unit Tests - run: | - go test -coverprofile=./cov.out ./... - - - name: Run Gosec Security Scanner - uses: securego/gosec@master - with: - args: '-no-fail -fmt=sonarqube -out report.json ./...' - - - name: SonarCloud Scan - uses: SonarSource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} \ No newline at end of file diff --git a/.goreleaser.yml b/.goreleaser.yml index cd019c15..01b81ab9 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -70,4 +70,8 @@ announce: enabled: true channel: '#release' username: GoReleaser - message_template: '{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}' \ No newline at end of file + message_template: 'New Release: {{ .ProjectName }} {{.Tag}} is published! Check it out at {{ .ReleaseURL }}' + + discord: + enabled: true + message_template: '**New Release: {{ .ProjectName }} {{.Tag}}** is published! Check it out at {{ .ReleaseURL }}' \ No newline at end of file