Skip to content

Commit 0754030

Browse files
committed
feat(ci): Adding CI to build different architectures of the plugin.
1 parent 832e316 commit 0754030

5 files changed

Lines changed: 184 additions & 0 deletions

File tree

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# See GitHub's documentation for more information on this file:
2+
# https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates
3+
version: 2
4+
updates:
5+
- package-ecosystem: "github-actions"
6+
directory: "/"
7+
schedule:
8+
interval: "daily"
9+
- package-ecosystem: "gomod"
10+
directory: "/"
11+
schedule:
12+
interval: "daily"

.github/images/kf_logo.png

3.52 KB
Loading
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Starter Workflow
2+
on: workflow_dispatch
3+
4+
jobs:
5+
catalog-update-check:
6+
runs-on: windows-latest
7+
outputs:
8+
upd_cat: ${{ steps.read-json.outputs.prop }}
9+
steps:
10+
- uses: actions/checkout@v3
11+
- name: Read json
12+
id: read-json
13+
shell: pwsh
14+
run: |
15+
$json = Get-Content integration-manifest.json | ConvertFrom-Json
16+
echo "::set-output name=prop::$(echo $json.update_catalog)"
17+
18+
#call-create-github-release-workflow:
19+
# uses: Keyfactor/actions/.github/workflows/github-release.yml@main
20+
21+
#call-dotnet-build-and-release-workflow:
22+
# needs: [call-create-github-release-workflow]
23+
# uses: Keyfactor/actions/.github/workflows/dotnet-build-and-release.yml@main
24+
# with:
25+
# release_version: ${{ needs.call-create-github-release-workflow.outputs.release_version }}
26+
# release_url: ${{ needs.call-create-github-release-workflow.outputs.release_url }}
27+
# release_dir: SslStoreCaProxy/bin/Release
28+
# secrets:
29+
# token: ${{ secrets.PRIVATE_PACKAGE_ACCESS }}
30+
31+
call-generate-readme-workflow:
32+
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
33+
uses: Keyfactor/actions/.github/workflows/generate-readme.yml@main
34+
secrets:
35+
token: ${{ secrets.APPROVE_README_PUSH }}
36+
37+
call-update-catalog-workflow:
38+
needs: catalog-update-check
39+
if: needs.catalog-update-check.outputs.upd_cat == 'True' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
40+
uses: Keyfactor/actions/.github/workflows/update-catalog.yml@main
41+
secrets:
42+
token: ${{ secrets.SDK_SYNC_PAT }}
43+

.github/workflows/release.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Terraform Provider release workflow.
2+
name: Release
3+
4+
# This GitHub action creates a release when a tag that matches the pattern
5+
# "v*" (e.g. v0.1.0) is created.
6+
on:
7+
push:
8+
tags:
9+
- 'v*'
10+
11+
# Releases need permissions to read and write the repository contents.
12+
# GitHub considers creating releases and uploading assets as writing contents.
13+
permissions:
14+
contents: write
15+
16+
jobs:
17+
goreleaser:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v3
21+
with:
22+
# Allow goreleaser to access older tag information.
23+
fetch-depth: 0
24+
- uses: actions/setup-go@v4
25+
with:
26+
go-version-file: 'go.mod'
27+
cache: true
28+
- name: Import GPG key
29+
uses: crazy-max/ghaction-import-gpg@v5
30+
id: import_gpg
31+
with:
32+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
33+
passphrase: ${{ secrets.PASSPHRASE }}
34+
- name: Run GoReleaser
35+
uses: goreleaser/goreleaser-action@v4
36+
with:
37+
args: release --clean
38+
env:
39+
# GitHub sets the GITHUB_TOKEN secret automatically.
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
PAT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
43+
GPG_TTY: $(tty)

.goreleaser.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Visit https://goreleaser.com for documentation on how to customize this
2+
# behavior.
3+
before:
4+
hooks:
5+
# this is just an example and not a requirement for provider building/publishing
6+
- go mod tidy
7+
builds:
8+
- env:
9+
# goreleaser does not work with CGO, it could also complicate
10+
# usage by users in CI/CD systems like Terraform Cloud where
11+
# they are unable to install libraries.
12+
- CGO_ENABLED=0
13+
mod_timestamp: '{{ .CommitTimestamp }}'
14+
flags:
15+
- -trimpath
16+
ldflags:
17+
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}'
18+
goos:
19+
- freebsd
20+
- windows
21+
- linux
22+
- darwin
23+
goarch:
24+
- amd64
25+
- '386'
26+
- arm
27+
- arm64
28+
ignore:
29+
- goos: darwin
30+
goarch: '386'
31+
binary: 'kfutil'
32+
archives:
33+
- format: zip
34+
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
35+
checksum:
36+
extra_files:
37+
- glob: 'integration-manifest.json'
38+
name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json'
39+
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
40+
algorithm: sha256
41+
signs:
42+
- artifacts: checksum
43+
args:
44+
# if you are using this in a GitHub action or some other automated pipeline, you
45+
# need to pass the batch flag to indicate its not interactive.
46+
- "--batch"
47+
- "--local-user"
48+
- "{{ .Env.GPG_FINGERPRINT }}" # set this environment variable for your signing key
49+
- "--output"
50+
- "${signature}"
51+
- "--detach-sign"
52+
- "${artifact}"
53+
release:
54+
prerelease: auto
55+
extra_files:
56+
- glob: 'integration-manifest.json'
57+
name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json'
58+
# If you want to manually examine the release before its live, uncomment this line:
59+
draft: true
60+
changelog:
61+
sort: asc
62+
use: github
63+
filters:
64+
exclude:
65+
- '^test:'
66+
- '^chore'
67+
- 'merge conflict'
68+
- Merge pull request
69+
- Merge remote-tracking branch
70+
- Merge branch
71+
- go mod tidy
72+
groups:
73+
- title: Dependency updates
74+
regexp: "^.*(feat|fix)\\(deps\\)*:+.*$"
75+
order: 300
76+
- title: 'New Features'
77+
regexp: "^.*feat[(\\w)]*:+.*$"
78+
order: 100
79+
- title: 'Bug fixes'
80+
regexp: "^.*fix[(\\w)]*:+.*$"
81+
order: 200
82+
- title: 'Documentation updates'
83+
regexp: "^.*docs[(\\w)]*:+.*$"
84+
order: 400
85+
- title: Other work
86+
order: 9999

0 commit comments

Comments
 (0)