Skip to content

Commit

Permalink
liblab SDK update (#29)
Browse files Browse the repository at this point in the history
Replace speakeasy code with code generated by liblab
  • Loading branch information
Angie authored Mar 22, 2024
1 parent 77961f9 commit 9ed5c01
Show file tree
Hide file tree
Showing 260 changed files with 6,541 additions and 12,530 deletions.
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: 'gomod' # See documentation for possible values
directory: '/' # Location of package manifests
open-pull-requests-limit: 25
schedule:
interval: 'daily'
- package-ecosystem: 'github-actions' # See documentation for possible values
directory: '/' # Location of package manifests
open-pull-requests-limit: 25
schedule:
interval: 'daily'
28 changes: 0 additions & 28 deletions .github/workflows/generate.yml

This file was deleted.

107 changes: 107 additions & 0 deletions .github/workflows/publish-provider.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: Publish Provider

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

permissions:
contents: write

jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.19'
stable: true

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

- name: Build the provider
run: go build -o terraform-provider-abbey

- name: Run Unit Tests
run: make unit-test

# Uncomment once you have acceptance tests set up and you want them to run on PR checks
# - name: Run Acceptance Tests
# run: make acceptance-test

release:
needs: build-and-test
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.19'
stable: true

# Import the GPG key before the build step that requires it
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
id: import_gpg
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref_name }}
draft: false
prerelease: false

publish:
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# Allow goreleaser to access older tag information.
fetch-depth: 0
- uses: actions/setup-go@v2
with:
go-version-file: 'go.mod'
cache: true
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
id: import_gpg
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
args: release --clean
env:
# GitHub sets the GITHUB_TOKEN secret automatically.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
59 changes: 59 additions & 0 deletions .github/workflows/pull-request-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Pull Request Checks

on:
pull_request:

permissions:
pull-requests: write
contents: write

jobs:
linting-and-testing:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.19'
stable: true

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

- name: Build the provider
run: go build -o terraform-provider-abbey .

- name: Generate Docs
run: go generate ./...

- name: Run Unit Tests
run: make unit-test

dependabot:
name: 'Dependabot'
needs: [linting-and-testing]
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}}
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1.6.0
with:
github-token: '${{ secrets.GITHUB_TOKEN }}'
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
46 changes: 0 additions & 46 deletions .github/workflows/release.yaml

This file was deleted.

9 changes: 0 additions & 9 deletions .golangci.yaml

This file was deleted.

65 changes: 36 additions & 29 deletions .goreleaser.yaml → .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
# Visit https://goreleaser.com for documentation on how to customize this
# behavior.
# This section defines how the artifacts should be archived
archives:
- format: zip
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'

# Set necessary hooks before go releaser executes
before:
hooks:
# this is just an example and not a requirement for provider building/publishing
- go mod tidy

# Build customization
builds:
- 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.
- binary: '{{ .ProjectName }}_v{{ .Version }}'
env:
- CGO_ENABLED=0
mod_timestamp: '{{ .CommitTimestamp }}'
flags:
Expand All @@ -28,33 +31,37 @@ builds:
ignore:
- goos: darwin
goarch: '386'
binary: '{{ .ProjectName }}_v{{ .Version }}'
archives:
- format: zip
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'

# Include a changelog or not
changelog:
skip: true

# Checksum and signing configuration
checksum:
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
algorithm: sha256
extra_files:
- glob: 'terraform-registry-manifest.json'
name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json'
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
algorithm: sha256
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
- "--output"
- "${signature}"
- "--detach-sign"
- "${artifact}"

# This section defines how the artifacts should be published
release:
extra_files:
- glob: 'terraform-registry-manifest.json'
name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json'
# If you want to manually examine the release before its live, uncomment this line:
# draft: true
changelog:
skip: true

# This section defines how the artifacts should be signed
signs:
- artifacts: checksum
args:
- '--batch'
- '--local-user'
- '{{ .Env.GPG_FINGERPRINT }}'
- '--output'
- '${signature}'
- '--detach-sign'
- '${artifact}'

# Snapshot configuration in case you want to create non-release builds
snapshot:
name_template: '{{ .Tag }}-snapshot'
Loading

0 comments on commit 9ed5c01

Please sign in to comment.