Skip to content

Commit e21444d

Browse files
authored
Merge d229b82 into 31dd7dd
2 parents 31dd7dd + d229b82 commit e21444d

File tree

84 files changed

+5048
-4086
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+5048
-4086
lines changed

.dockerignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file
22
# Ignore build and test binaries.
33
bin/
4-
testbin/

.github/workflows/helm.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Build and Release
2+
on:
3+
push:
4+
branches:
5+
- '*'
6+
pull_request:
7+
branches:
8+
- 'v*'
9+
types:
10+
# action should run when the pull request is closed
11+
# (regardless of whether it was merged or just closed)
12+
- closed
13+
# Make sure the action runs every time new commits are
14+
# pushed to the pull request's branch
15+
- synchronize
16+
17+
env:
18+
REGISTRY: ghcr.io
19+
20+
jobs:
21+
helm:
22+
runs-on: ubuntu-latest
23+
if: github.event.pull_request.merged == true
24+
steps:
25+
- name: Set IMAGE_NAME
26+
run: |
27+
echo "IMAGE_NAME=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}
28+
29+
# Checkout code
30+
# https://github.com/actions/checkout
31+
- name: Checkout code
32+
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
33+
34+
# Extract metadata (tags, labels) to use in Helm chart
35+
# https://github.com/docker/metadata-action
36+
- name: Extract Docker metadata
37+
id: meta
38+
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
39+
with:
40+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
41+
42+
# Set version from DOCKER_METADATA_OUTPUT_VERSION as environment variable
43+
- name: Set Version
44+
run: |
45+
echo "VERSION=${DOCKER_METADATA_OUTPUT_VERSION:1}" >> $GITHUB_ENV
46+
47+
# Change version and appVersion in Chart.yaml to the tag in the closed PR
48+
- name: Update Helm App/Chart Version
49+
shell: bash
50+
run: |
51+
sed -i "s/^version: .*/version: ${{ env.VERSION }}/g" deploy/charts/command-cert-manager-issuer/Chart.yaml
52+
sed -i "s/^appVersion: .*/appVersion: \"${{ env.DOCKER_METADATA_OUTPUT_VERSION }}\"/g" deploy/charts/command-cert-manager-issuer/Chart.yaml
53+
54+
# Setup Helm
55+
# https://github.com/Azure/setup-helm
56+
- name: Install Helm
57+
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
58+
with:
59+
token: ${{ secrets.GITHUB_TOKEN }}
60+
61+
# Helm requires an ident name to be set for chart-releaser to work
62+
- name: Configure Git
63+
run: |
64+
git config user.name "$GITHUB_ACTOR"
65+
git config user.email "[email protected]"
66+
67+
# Build and release Helm chart to GitHub Pages
68+
# https://github.com/helm/chart-releaser-action
69+
- name: Run chart-releaser
70+
uses: helm/chart-releaser-action@be16258da8010256c6e82849661221415f031968 # v1.5.0
71+
env:
72+
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
73+
with:
74+
charts_dir: deploy/charts
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Keyfactor Bootstrap Workflow
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
types: [opened, closed, synchronize, edited, reopened]
7+
push:
8+
create:
9+
branches:
10+
- 'release-*.*'
11+
12+
jobs:
13+
14+
build:
15+
name: Build and Lint
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 5
18+
steps:
19+
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
20+
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
21+
with:
22+
go-version-file: 'go.mod'
23+
cache: true
24+
- run: go mod download
25+
- run: go build -v ./cmd/main.go
26+
# - name: Run linters
27+
# uses: golangci/golangci-lint-action@08e2f20817b15149a52b5b3ebe7de50aff2ba8c5 # v3.4.0
28+
# with:
29+
# version: latest
30+
31+
test:
32+
name: Go Test
33+
needs: build
34+
runs-on: ubuntu-latest
35+
timeout-minutes: 5
36+
steps:
37+
- name: Checkout
38+
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
39+
- name: Set up Go 1.x
40+
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
41+
with:
42+
go-version-file: 'go.mod'
43+
cache: true
44+
- run: go mod download
45+
- name: Run go test
46+
run: go test -v ./...
47+
48+
call-starter-workflow:
49+
uses: keyfactor/actions/.github/workflows/starter.yml@v3
50+
needs: test
51+
secrets:
52+
token: ${{ secrets.V2BUILDTOKEN}}
53+
APPROVE_README_PUSH: ${{ secrets.APPROVE_README_PUSH}}
54+
gpg_key: ${{ secrets.KF_GPG_PRIVATE_KEY }}
55+
gpg_pass: ${{ secrets.KF_GPG_PASSPHRASE }}
56+
scan_token: ${{ secrets.SAST_TOKEN }}
57+
docker-user: ${{ secrets.DOCKER_USER }}
58+
docker-token: ${{ secrets.DOCKER_PWD }}
59+

.github/workflows/release.yml

Lines changed: 0 additions & 213 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)