0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-07-01 11:02:59 +00:00

Attempt to fix GPG issues

This commit is contained in:
Dan Petersen 2021-02-10 03:14:00 +01:00
parent b2858a6bfc
commit 22750fd5a4
4 changed files with 133 additions and 45 deletions

View File

@ -18,19 +18,43 @@ jobs:
uses: actions/setup-go@v2
with:
go-version: 1.15
-
name: Install the required version of GoReleaser
env:
GORELEASER_VERSION: '0.155.1'
run: |
curl -sL -o goreleaser_amd64.deb "https://github.com/goreleaser/goreleaser/releases/download/v${GORELEASER_VERSION}/goreleaser_amd64.deb"
sudo dpkg -i goreleaser_amd64.deb
rm -f goreleaser_amd64.deb
-
name: Import the GPG signing key
id: import_gpg
uses: danitso/ghaction-import-gpg@master
with:
gpg-private-key: ${{ secrets.GPG_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
env:
GPG_KEY: ${{ secrets.GPG_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: |
mkdir -p ~/.gnupg
cat << EOF > ~/.gnupg/gpg.conf
use-agent
pinentry-mode loopback
EOF
echo "$GPG_KEY" | base64 -d | gpg --batch --allow-secret-key-import --import
gpg --keyid-format LONG --list-secret-keys
cat << EOF > ~/.gnupg/gpg-agent.conf
default-cache-ttl 7200
max-cache-ttl 31536000
allow-loopback-pinentry
allow-preset-passphrase
EOF
echo RELOADAGENT | gpg-connect-agent
printf '%s' "$GPG_PASSPHRASE" > ./.gpg_passphrase
-
name: Create release
uses: danitso/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
GPG_FINGERPRINT: ${{ secrets.GPG_FINGERPRINT }}
run: |
goreleaser build --parallelism 2 --rm-dist --timeout 1h

View File

@ -20,19 +20,43 @@ jobs:
uses: actions/setup-go@v2
with:
go-version: 1.15
-
name: Install the required version of GoReleaser
env:
GORELEASER_VERSION: '0.155.1'
run: |
curl -sL -o goreleaser_amd64.deb "https://github.com/goreleaser/goreleaser/releases/download/v${GORELEASER_VERSION}/goreleaser_amd64.deb"
sudo dpkg -i goreleaser_amd64.deb
rm -f goreleaser_amd64.deb
-
name: Import the GPG signing key
id: import_gpg
uses: danitso/ghaction-import-gpg@master
with:
gpg-private-key: ${{ secrets.GPG_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
env:
GPG_KEY: ${{ secrets.GPG_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: |
mkdir -p ~/.gnupg
cat << EOF > ~/.gnupg/gpg.conf
use-agent
pinentry-mode loopback
EOF
echo "$GPG_KEY" | base64 -d -i | gpg --batch --allow-secret-key-import --import
gpg --keyid-format LONG --list-secret-keys
cat << EOF > ~/.gnupg/gpg-agent.conf
default-cache-ttl 7200
max-cache-ttl 31536000
allow-loopback-pinentry
allow-preset-passphrase
EOF
echo RELOADAGENT | gpg-connect-agent
printf '%s' "$GPG_PASSPHRASE" > ./.gpg_passphrase
-
name: Create release
uses: danitso/goreleaser-action@v2
with:
version: latest
args: release --rm-dist --snapshot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
GPG_FINGERPRINT: ${{ secrets.GPG_FINGERPRINT }}
run: |
goreleaser build --parallelism 2 --rm-dist --snapshot --timeout 1h

37
.goreleaser.test.yml Normal file
View File

@ -0,0 +1,37 @@
before:
hooks:
- go mod tidy
builds:
- env:
- CGO_ENABLED=0
mod_timestamp: '{{ .CommitTimestamp }}'
flags:
- -trimpath
ldflags:
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}'
goos:
- freebsd
- windows
- linux
- darwin
goarch:
- amd64
- '386'
- arm
- arm64
ignore:
- goos: darwin
goarch: '386'
binary: '{{ .ProjectName }}_v{{ .Version }}'
archives:
- format: zip
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
checksum:
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
algorithm: sha256
signs:
- artifacts: none
release:
draft: false
changelog:
skip: true

View File

@ -2,30 +2,30 @@ before:
hooks:
- go mod tidy
builds:
- env:
- CGO_ENABLED=0
mod_timestamp: '{{ .CommitTimestamp }}'
flags:
- -trimpath
ldflags:
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}'
goos:
- freebsd
- windows
- linux
- darwin
goarch:
- amd64
- '386'
- arm
- arm64
ignore:
- goos: darwin
goarch: '386'
binary: '{{ .ProjectName }}_v{{ .Version }}'
- env:
- CGO_ENABLED=0
mod_timestamp: '{{ .CommitTimestamp }}'
flags:
- -trimpath
ldflags:
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}'
goos:
- freebsd
- windows
- linux
- darwin
goarch:
- amd64
- '386'
- arm
- arm64
ignore:
- goos: darwin
goarch: '386'
binary: '{{ .ProjectName }}_v{{ .Version }}'
archives:
- format: zip
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
- format: zip
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
checksum:
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
algorithm: sha256
@ -37,8 +37,11 @@ signs:
- "{{ .Env.GPG_FINGERPRINT }}"
- "--output"
- "${signature}"
- "--passphrase-fd"
- "0"
- "--detach-sign"
- "${artifact}"
stdin_file: ./.gpg_passphrase
release:
draft: false
changelog: