Skip to content

Commit

Permalink
feat: sign release with keyless
Browse files Browse the repository at this point in the history
  • Loading branch information
alikhil committed Sep 20, 2023
1 parent ea79b10 commit cc47983
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 10 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,19 @@ jobs:
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
# - name: Import GPG key
# id: import_gpg
# uses: crazy-max/ghaction-import-gpg@v6
# with:
# gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
# passphrase: ${{ secrets.PASSPHRASE }}
- name: Install Cosign
uses: sigstore/cosign-installer@v3
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
# GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
17 changes: 15 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,18 @@ release:
name: tflint-ruleset-ke

signs:
- artifacts: checksum
args: ["--batch", "-u", "{{ .Env.GPG_FINGERPRINT }}", "--output", "${signature}", "--detach-sign", "${artifact}"]
- cmd: cosign
signature: '${artifact}.keyless.sig'
certificate: '${artifact}.pem'
output: true
artifacts: checksum
args:
- sign-blob
- '--output-certificate=${certificate}'
- '--output-signature=${signature}'
- '${artifact}'
- --yes

# signs:
# - artifacts: checksum
# args: ["--batch", "-u", "{{ .Env.GPG_FINGERPRINT }}", "--output", "${signature}", "--detach-sign", "${artifact}"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ You can install the plugin with `tflint --init`. Declare a config in `.tflint.hc
plugin "ke" {
enabled = true
version = "0.4.0"
version = "0.4.1"
source = "github.com/KazanExpress/tflint-ruleset-ke-ke"
signing_key = <<EOF
Expand Down

0 comments on commit cc47983

Please sign in to comment.