Skip to content

Commit

Permalink
Added changie, upgraded to go 1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
demeyerthom committed Sep 15, 2023
1 parent ac580ab commit c9a59e0
Show file tree
Hide file tree
Showing 15 changed files with 325 additions and 448 deletions.
6 changes: 6 additions & 0 deletions .changes/header.tpl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
and is generated by [Changie](https://github.com/miniscruff/changie).
Empty file added .changes/unreleased/.gitkeep
Empty file.
3 changes: 3 additions & 0 deletions .changes/unreleased/Added-20230915-152449.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: Added
body: Updated to go 1.21
time: 2023-09-15T15:24:49.507015744+02:00
15 changes: 15 additions & 0 deletions .changes/v0.2.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## 0.2.0 (2022-06-07)

- Add the `contentstack_content_type` resource.
- Add the `contentstack_locale` resource.


## 0.1.1 (2022-06-03)

- Add the `contentstack_global_field` resource.


## 0.1.0 (2022-06-03)

Initial release of the contentstack terraform provider. It currently only
supports managing webhooks via the `contentstack_webhook` resource.
26 changes: 26 additions & 0 deletions .changie.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
changesDir: .changes
unreleasedDir: unreleased
headerPath: header.tpl.md
changelogPath: CHANGELOG.md
versionExt: md
versionFormat: '## {{.Version}} - {{.Time.Format "2006-01-02"}}'
kindFormat: '### {{.Kind}}'
changeFormat: '* {{.Body}}'
kinds:
- label: Added
auto: minor
- label: Changed
auto: major
- label: Deprecated
auto: minor
- label: Removed
auto: major
- label: Fixed
auto: patch
- label: Security
auto: patch
newlines:
afterChangelogHeader: 1
beforeChangelogVersion: 1
endOfVersion: 1
envPrefix: CHANGIE_
33 changes: 33 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: release
on:
workflow_dispatch:

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21"

- name: Import GPG key
id: import_gpg
uses: paultyng/[email protected]
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50 changes: 0 additions & 50 deletions .github/workflows/release.yml

This file was deleted.

113 changes: 0 additions & 113 deletions .github/workflows/test.yml

This file was deleted.

71 changes: 71 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# This GitHub action runs your tests for each commit push and/or PR. Optionally
# you can turn it on using a cron schedule for regular testing.
#
name: Tests
on:
pull_request:
paths-ignore:
- 'README.md'
push:
paths-ignore:
- 'README.md'

jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
cache: true
- run: go generate ./...
- name: git diff
run: |
git diff --compact-summary --exit-code || \
(echo; echo "Unexpected difference in directories after code generation. Run 'go generate ./...' command and commit."; exit 1)
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Go 1.21
uses: actions/setup-go@v2
with:
go-version: "1.21"

- name: golangci-lint
continue-on-error: true
uses: golangci/golangci-lint-action@v3
with:
args: --issues-exit-code=0 --timeout=5m

- name: Run tests
run: go test -race -coverprofile=coverage.out -covermode=atomic -coverpkg=./... -v ./...

- name: Upload to codecov
uses: codecov/codecov-action@v3
with:
verbose: true

changie:
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
permissions:
contents: write
pull-requests: write
actions: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Prepare release
uses: labd/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
release-workflow: 'release.yaml'

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@
/main.tf
/terraform-provider-contentstack_*
/terraform-provider-contentstack

/.idea
/.vscode
33 changes: 0 additions & 33 deletions .vscode/launch.json

This file was deleted.

8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
and is generated by [Changie](https://github.com/miniscruff/changie).


## 0.2.0 (2022-06-07)

- Add the `contentstack_content_type` resource.
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/content_type.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ JSON
### Required

- `title` (String)
- `uid` (String)

### Optional

- `description` (String)
- `schema` (String) The schema as JSON. Use jsonencode(jsonecode(<schema>)) to work around wrong changes.
- `uid` (String)


Loading

0 comments on commit c9a59e0

Please sign in to comment.