From 3ef9fb8afad8546b8ffe9723295f75aae6f1e78e Mon Sep 17 00:00:00 2001 From: Prasad Tengse Date: Mon, 8 Apr 2024 04:42:54 +0200 Subject: [PATCH] update --- .github/workflows/build.yml | 20 ++++++++++++++------ .github/workflows/release.yml | 23 ++++++++++------------- .goreleaser.yml | 12 +++++++++++- Makefile | 4 ---- 4 files changed, 35 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3798f28..52ced44 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,8 +8,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Shellcheck run: make shellcheck + build: runs-on: ubuntu-latest steps: @@ -17,20 +19,26 @@ jobs: with: fetch-depth: 0 persist-credentials: false + - name: Set up QEMU uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Install GoReleaser + - name: GoReleaser uses: goreleaser/goreleaser-action@v5 with: version: latest - install-only: true + args: release --snapshot --clean - - name: Install help2man - run: sudo apt-get install -y help2man + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + persist-credentials: false - - name: Run GoReleaser - run: make snapshot + - name: Build docker image + run: make docker diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7e22d08..aa11b2a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,12 +7,16 @@ on: jobs: shellcheck: runs-on: ubuntu-latest + permissions: + contents: read steps: - uses: actions/checkout@v4 - name: Shellcheck run: make shellcheck build: runs-on: ubuntu-latest + needs: + - shellcheck permissions: contents: write packages: write @@ -29,18 +33,9 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Install GoReleaser - uses: goreleaser/goreleaser-action@v5 - with: - version: latest - install-only: true - - name: Install Cosign uses: sigstore/cosign-installer@v3.4.0 - - name: Install help2man - run: sudo apt-get install -y help2man - - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: @@ -48,7 +43,9 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Run GoReleaser - run: make release-prod - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: GoReleaser + uses: goreleaser/goreleaser-action@v5 + id: goreleaser + with: + version: latest + args: release --clean diff --git a/.goreleaser.yml b/.goreleaser.yml index 9ffe015..288052c 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -193,7 +193,17 @@ release: skip_upload: true docker_signs: - - cmd: cosign + - id: images + cmd: cosign + artifacts: images + output: true + args: + - "sign" + - "${artifact}@${digest}" + - --yes + + - id: manifests + cmd: cosign artifacts: manifests output: true args: diff --git a/Makefile b/Makefile index 962b0f5..46a62b7 100644 --- a/Makefile +++ b/Makefile @@ -52,10 +52,6 @@ release: ## Build release --skip-announce \ --skip-sign -.PHONY: release-prod -release-prod: ## Build release and publish - goreleaser release --clean - .PHONY: clean clean: ## clean rm -rf $(REPO_ROOT)/dist/