Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test PR #3

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 45 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,48 @@ on:

name: release
jobs:
terraform-provider-release:
name: 'Terraform Provider Release'
uses: hashicorp/ghaction-terraform-provider-release/.github/workflows/community.yml@v2
secrets:
gpg-private-key: '${{ secrets.GPG_PRIVATE_KEY }}'
with:
setup-go-version-file: 'go.mod'
Release:
runs-on: ubuntu-latest
env:
GOPRIVATE: gitlab.com/nitrado/*

steps:
- name: Install Go
if: success()
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

- name: Checkout code
uses: actions/checkout@v4

- name: Create .netrc
uses: extractions/netrc@v1
with:
machine: gitlab.com
username: ${{ secrets.GITLAB_USERNAME }}
password: ${{ secrets.GITLAB_TOKEN }}

- name: Cache Go modules
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-

- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSWORD }}

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
with:
version: latest
args: release --clean
17 changes: 15 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ on:

name: run tests
jobs:
test:
Test:

runs-on: ubuntu-latest
env:
GO_VERSION: "1.21"
GOPRIVATE: gitlab.com/nitrado/*
GOLANGCI_LINT_VERSION: v1.54.2

steps:
Expand All @@ -23,6 +24,13 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Create .netrc
uses: extractions/netrc@v1
with:
machine: gitlab.com
username: ${{ secrets.GITLAB_USERNAME }}
password: ${{ secrets.GITLAB_TOKEN }}

- name: Cache Go modules
uses: actions/cache@v3
with:
Expand All @@ -31,10 +39,15 @@ jobs:
restore-keys: |
${{ runner.os }}-go-

- name: Download Go modules
run: |
go mod download

- name: Run linter
uses: golangci/golangci-lint-action@v3
with:
version: ${{ env.GOLANGCI_LINT_VERSION }}
skip-pkg-cache: true
args: --go ${{ env.GO_VERSION }}

- name: Run tests
Expand All @@ -44,4 +57,4 @@ jobs:
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --clean --snapshot
args: release --clean --snapshot --skip=sign
8 changes: 1 addition & 7 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ env:

builds:
- id: terraform-provider-ec
binary: "terraform-provider-ec_{{ .Version }}"
binary: "{{ .ProjectName }}_v{{ .Version }}"
flags:
- -trimpath
ldflags:
Expand Down Expand Up @@ -49,14 +49,8 @@ release:

signs:
- artifacts: checksum
stdin: '{{ .Env.GPG_PASSWORD }}'
args:
- "--batch"
- "--no-tty"
- "--pinentry-mode"
- "loopback"
- "--passphrase"
- '{{ .Env.GPG_PASSWORD }}'
- "--local-user"
- "{{ .Env.GPG_FINGERPRINT }}"
- "--output"
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ lint:
#Build

build:
@goreleaser release --clean --snapshot
@goreleaser release --clean --snapshot --skip=sign
.PHONY: build

# Schema Generation
Expand Down
Loading