From 572f4ccf9b65685c18f60f64951b7ba9f4e8a6be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Pud=C5=82owski?= Date: Sun, 18 Aug 2024 15:22:50 +0200 Subject: [PATCH] adding release 2.1.3 --- .github/workflows/ci.yml | 2 +- .github/workflows/golangci-lint.yaml | 40 +++++++++++++++++++++++ .github/workflows/release.yaml | 48 ++++++++++++++++++++++++++++ .gitignore | 1 + Dockerfile | 2 +- Makefile | 2 +- deploy.env | 2 +- go.mod | 2 +- 8 files changed, 94 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/golangci-lint.yaml create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f756ce6..939d652 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: - name: Set up GO uses: actions/setup-go@v1 with: - go-version: 1.13 + go-version: 1.22 - name: Checkout code uses: actions/checkout@master diff --git a/.github/workflows/golangci-lint.yaml b/.github/workflows/golangci-lint.yaml new file mode 100644 index 0000000..05bec50 --- /dev/null +++ b/.github/workflows/golangci-lint.yaml @@ -0,0 +1,40 @@ +name: Golang lint issuer +on: + workflow_dispatch: + push: + paths: + - 'api/**.go' + - 'cmd/**.go' + - 'globals/**.go' + - 'config/**.go' + - 'controllers/**.go' + - 'internal/**.go' + - 'version/**.go' + - '**.go' + + branches: + - main + pull_request: + +permissions: + contents: read + # Optional: allow read access to pull request. Use with `only-new-issues` option. + pull-requests: read + +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: '1.22' + - name: golangci-lint + uses: golangci/golangci-lint-action@v6 + with: + args: --timeout=3m + version: v1.58 + skip-cache: true + skip-save-cache: true + cache-invalidation-interval: 15 \ No newline at end of file diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..a8654f9 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,48 @@ +name: Publish Docker image on Release + +on: + workflow_dispatch: + branches: [ main ] + release: + types: [published] + + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + + - name: Get the tag version for building image + id: get_version + run: echo "VERSION=$(echo $GITHUB_REF | cut -d / -f 3)" >> $GITHUB_OUTPUT + + + - name: Get current date for building image + id: get_date + run: echo "BUILD_TIME=$(date -u '+%Y-%m-%d_%H:%M:%S')" >> $GITHUB_OUTPUT + + - name: Get commit hash for building image + id: get_commit + run: echo "COMMIT=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + + - name: Print name + id: print_args + run: echo "Hello VERSION. ${{ steps.get_version.outputs.VERSION }} . COMMIT. ${{ steps.get_commit.outputs.COMMIT }} BUILD_TIME. ${{steps.get_date.outputs.BUILD_TIME }}" + + + - name: Publish to Registry + uses: elgohr/Publish-Docker-Github-Action@v5 + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' + PROJECT: github.com/djkormo/adcs-issuer + COMMIT: ${{ steps.get_commit.outputs.COMMIT }} + VERSION: ${{ steps.get_version.outputs.VERSION }} + BUILD_TIME: ${{steps.get_date.outputs.BUILD_TIME }} + with: + name: djkormo/adcs-issuer + buildargs: PROJECT,COMMIT,BUILD_TIME,VERSION + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + tags: "latest,${{ env.VERSION }}" + tag_semver: true diff --git a/.gitignore b/.gitignore index 924403e..ff7b3a9 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,4 @@ adcs-sim *.key *-all.yaml *.exe +adcs-issuer \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index a43d52e..25022da 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Build the manager binary -FROM golang:1.21 as builder +FROM golang:1.22 as builder ARG VERSION diff --git a/Makefile b/Makefile index c9f81a5..d5fa5a1 100644 --- a/Makefile +++ b/Makefile @@ -232,7 +232,7 @@ GOLANGCI_LINT = $(LOCALBIN)/golangci-lint-$(GOLANGCI_LINT_VERSION) KUSTOMIZE_VERSION ?= v5.3.0 CONTROLLER_TOOLS_VERSION ?= v0.14.0 ENVTEST_VERSION ?= latest -GOLANGCI_LINT_VERSION ?= v1.54.2 +GOLANGCI_LINT_VERSION ?= v1.58.2 .PHONY: kustomize kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. diff --git a/deploy.env b/deploy.env index f9fe938..8e749da 100644 --- a/deploy.env +++ b/deploy.env @@ -1,6 +1,6 @@ APP_NAME=adcs-issuer DOCKER_REPO=djkormo -VERSION=2.1.2 +VERSION=2.1.3 diff --git a/go.mod b/go.mod index d63dbf1..f9a3183 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/nokia/adcs-issuer -go 1.21 +go 1.22 require ( github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358