0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-07-03 03:52:58 +00:00

Merge pull request #17 from bpg/release-to-registry

Publish to TF registry
This commit is contained in:
Pavel Boldyrev 2021-09-09 20:50:16 -04:00 committed by GitHub
commit 5a328e12ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 1662 additions and 105 deletions

View File

@ -1,31 +1,24 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
# Maintain dependencies for Go
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
# Maintain dependencies for build tools
- package-ecosystem: "gomod"
directory: "/tools"
schedule:
interval: "weekly"
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "gomod"
directory: "/"
ignore:
- dependency-name: "golang.org/x/tools"
- dependency-name: "google.golang.org/grpc"
schedule:
interval: "daily"
- package-ecosystem: "gomod"
directory: "/awsproviderlint"
ignore:
- dependency-name: "golang.org/x/tools"
- dependency-name: "google.golang.org/grpc"
schedule:
interval: "daily"
- package-ecosystem: "gomod"
directory: "/tools"
ignore:
- dependency-name: "golang.org/x/tools"
- dependency-name: "google.golang.org/grpc"
schedule:
interval: "daily"
- package-ecosystem: "terraform"
directory: "/infrastructure/repository"
schedule:
interval: "daily"
interval: "weekly"

View File

@ -1,62 +1,48 @@
name: Create release
# This GitHub action can publish assets for release when a tag is created.
# Currently its setup to run on any tag that matches the pattern "v*" (ie. v0.1.0).
#
# This uses an action (hashicorp/ghaction-import-gpg) that assumes you set your
# private key in the `GPG_PRIVATE_KEY` secret and passphrase in the `PASSPHRASE`
# secret. If you would rather own your own GPG handling, please fork this action
# or use an alternative one for key handling.
#
# You will need to pass the `--batch` flag to `gpg` in your signing step
# in `goreleaser` to indicate this is being used in a non-interactive mode.
#
name: release
on:
push:
tags:
- 'v*'
jobs:
release:
name: Tag
runs-on: ubuntu-20.04
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout the code
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Install and configure Go
- name: Unshallow
run: git fetch --prune --unshallow
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
-
name: Install and configure 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
env:
GPG_KEY: ${{ secrets.GPG_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: |
mkdir -p ~/.gnupg
chmod 0700 ~/.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" > /tmp/.gpg_passphrase
-
name: Create release
go-version: 1.16
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v4
with:
git_user_signingkey: true
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2.7.0
with:
version: latest
args: release --rm-dist
env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
# GitHub sets this automatically
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ secrets.GPG_FINGERPRINT }}
run: |
goreleaser release --parallelism 2 --rm-dist --timeout 1h

View File

@ -1,43 +1,44 @@
archives:
- files:
- none*
format: zip
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
# Visit https://goreleaser.com for documentation on how to customize this
# behavior.
before:
hooks:
- go mod download
builds:
- binary: '{{ .ProjectName }}_{{ .Version }}'
- env:
# goreleaser does not work with CGO, it could also complicate
# usage by users in CI/CD systems like Terraform Cloud where
# they are unable to install libraries.
- 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:
- '386'
- amd64
- '386'
- arm
- arm64
goos:
- darwin
- freebsd
- linux
- windows
ignore:
- goarch: '386'
goos: darwin
ldflags:
- -s -w -X version.ProviderVersion={{.Version}}
mod_timestamp: '{{ .CommitTimestamp }}'
changelog:
skip: true
- 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
env:
- CGO_ENABLED=0
release:
disable: true
signs:
- artifacts: checksum
args:
# if you are using this in a GitHub action or some other automated pipeline, you
# need to pass the batch flag to indicate its not interactive.
- "--batch"
- "--local-user"
- "{{ .Env.GPG_FINGERPRINT }}" # set this environment variable for your signing key
@ -45,3 +46,8 @@ signs:
- "${signature}"
- "--detach-sign"
- "${artifact}"
release:
# If you want to manually examine the release before its live, uncomment this line:
draft: true
changelog:
skip: true

View File

@ -3,8 +3,8 @@ data "proxmox_virtual_environment_groups" "example" {
}
output "data_proxmox_virtual_environment_groups_example" {
value = map(
"comments", data.proxmox_virtual_environment_groups.example.comments,
"group_ids", data.proxmox_virtual_environment_groups.example.group_ids,
)
value = tomap({
"comments" = data.proxmox_virtual_environment_groups.example.comments
"group_ids" = data.proxmox_virtual_environment_groups.example.group_ids
})
}

View File

@ -9,5 +9,5 @@ const (
TerraformProviderName = "terraform-provider-proxmox"
// TerraformProviderVersion specifies the version number.
TerraformProviderVersion = "0.4.5"
TerraformProviderVersion = "0.4.6"
)

8
tools/go.mod Normal file
View File

@ -0,0 +1,8 @@
module github.com/golang-templates/seed/build
go 1.16
require (
github.com/golangci/golangci-lint v1.42.0
github.com/goreleaser/goreleaser v0.176.0
)

1552
tools/go.sum Normal file

File diff suppressed because it is too large Load Diff

12
tools/tools.go Normal file
View File

@ -0,0 +1,12 @@
// +build tools
package tools
// Manage tool dependencies via go.mod.
//
// https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module
// https://github.com/golang/go/issues/25922
import (
_ "github.com/golangci/golangci-lint/cmd/golangci-lint"
_ "github.com/goreleaser/goreleaser"
)