Skip to content

Commit b77a8fc

Browse files
authored
Merge pull request #6 from CruGlobal/update-client-fix-tests
fix: Update API client and fix GitHub workflows
2 parents a8ab25a + fa0d1a8 commit b77a8fc

19 files changed

+256
-64
lines changed

.github/release-drafter.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# This release drafter follows the conventions
2+
# from https://keepachangelog.com
3+
4+
name-template: 'v$RESOLVED_VERSION'
5+
tag-template: 'v$RESOLVED_VERSION'
6+
template: '$CHANGES'
7+
category-template: '### $TITLE'
8+
categories:
9+
- title: Added
10+
labels:
11+
- feature
12+
- enhancement
13+
- title: Fixed
14+
labels:
15+
- fix
16+
- bug
17+
- title: Changed
18+
labels:
19+
- changed
20+
- title: Deprecated
21+
labels:
22+
- deprecated
23+
- title: Removed
24+
labels:
25+
- removed
26+
- title: Security
27+
labels:
28+
- security
29+
- title: Documentation
30+
labels:
31+
- docs
32+
- documentation
33+
- title: Dependency Updates
34+
labels:
35+
- deps
36+
- dependencies
37+
collapse-after: 5
38+
39+
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
40+
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
41+
version-resolver:
42+
major:
43+
labels:
44+
- major
45+
minor:
46+
labels:
47+
- minor
48+
patch:
49+
labels:
50+
- patch
51+
default: patch
52+
53+
exclude-labels:
54+
- skip-changelog

.github/workflows/check-pr.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Label Checker
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
- reopened
9+
- labeled
10+
- unlabeled
11+
- edited
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
check_semver_labels:
19+
name: Check Semver labels
20+
if: github.base_ref == 'main'
21+
runs-on: ubuntu-latest
22+
permissions:
23+
pull-requests: read
24+
checks: write
25+
steps:
26+
- name: Check for Semver labels
27+
uses: danielchabr/[email protected]
28+
with:
29+
hasSome: major,minor,patch
30+
githubToken: ${{ secrets.GITHUB_TOKEN }}
31+
32+
check_cc_labels:
33+
name: Check conventional commits labels
34+
if: github.base_ref == 'main'
35+
runs-on: ubuntu-latest
36+
permissions:
37+
pull-requests: read
38+
checks: write
39+
steps:
40+
- uses: danielchabr/[email protected]
41+
with:
42+
hasSome: feature,enhancement,fix,bug,changed,deprecated,removed,security,docs,documentation,deps,dependencies
43+
githubToken: ${{ secrets.GITHUB_TOKEN }}
44+
45+
title-checker:
46+
runs-on: ubuntu-latest
47+
steps:
48+
- uses: amannn/[email protected]
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
update_release_draft:
13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Update Release Draft
19+
uses: release-drafter/release-drafter@v5
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
# Terraform Provider testing workflow.
22
name: Tests
33

4-
# This GitHub action runs your tests for each pull request and push.
5-
# Optionally, you can turn it on using a schedule for regular testing.
4+
# This GitHub action runs your tests for each pull request.
65
on:
76
pull_request:
8-
paths-ignore:
9-
- 'README.md'
10-
push:
11-
paths-ignore:
12-
- 'README.md'
7+
branches:
8+
- main
139

1410
# Testing only needs permissions to read the repository contents.
1511
permissions:
@@ -33,6 +29,7 @@ jobs:
3329
uses: golangci/golangci-lint-action@v6
3430
with:
3531
version: latest
32+
args: --tests=false
3633

3734
generate:
3835
runs-on: ubuntu-latest
@@ -74,7 +71,7 @@ jobs:
7471
with:
7572
go-version-file: 'go.mod'
7673
cache: true
77-
- uses: hashicorp/setup-terraformv3
74+
- uses: hashicorp/setup-terraform@v3
7875
with:
7976
terraform_version: '1.9.x' # '${{ matrix.terraform }}
8077
terraform_wrapper: false
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Update Changelog
2+
3+
on:
4+
release:
5+
types:
6+
- released
7+
8+
jobs:
9+
update:
10+
runs-on: ubuntu-latest
11+
12+
permissions:
13+
# Give the default GITHUB_TOKEN write permission to commit and push the
14+
# updated CHANGELOG back to the repository.
15+
# https://github.blog/changelog/2023-02-02-github-actions-updating-the-default-github_token-permissions-to-read-only/
16+
contents: write
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
with:
22+
ref: ${{ github.event.release.target_commitish }}
23+
token: ${{ secrets.CRU_DEPLOY_GITHUB_TOKEN }}
24+
25+
- name: Update Changelog
26+
uses: stefanzweifel/changelog-updater-action@v1
27+
with:
28+
latest-version: ${{ github.event.release.tag_name }}
29+
release-notes: ${{ github.event.release.body }}
30+
31+
- name: Commit updated CHANGELOG
32+
uses: stefanzweifel/git-auto-commit-action@v5
33+
with:
34+
branch: ${{ github.event.release.target_commitish }}
35+
commit_message: 'docs(changelog): update changelog'
36+
file_pattern: CHANGELOG.md

.pre-commit-config.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/golangci/golangci-lint
5+
rev: v1.62.2
6+
hooks:
7+
- id: golangci-lint
8+
args:
9+
- "--tests=false"
10+
- repo: https://github.com/antonbabenko/pre-commit-terraform
11+
rev: v1.96.2
12+
hooks:
13+
- id: terraform_fmt

.tool-versions

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
terraform 1.9.8
2+
pre-commit 4.0.1

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
11+
[unreleased]: https://github.com/CruGlobal/terraform-provider-semaphoreui/compare/main...HEAD
12+
13+
## [v1.0.0](https://github.com/CruGlobal/terraform-provider-semaphoreui/compare/v0.1.1...v1.0.0) - 2024-11-20
14+
15+
### Added
16+
17+
- Initial release of the provider

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22

33
The [SemaphoreUI Provider](https://registry.terraform.io/providers/CruGlobal/semaphoreui/latest/docs) enables [Terraform](https://terraform.io) to manage [SemaphoreUI](https://semaphoreui.com/) resources.
44

5+
This project uses Conventional Commits in order to automatically manage releases as well as keeping the CHANGELOG.md updated. CHANGELOG follows the Keep a Changelog spec.
6+
57
## WARNING
68
This provider requires changes to SemaphoreUI API which are not yet released. It will not function until those changes have been released. https://github.com/semaphoreui/semaphore/pull/2553
9+
Changes are currently in the `develop` branch of the SemaphoreUI project.
710

811

912
### SemaphoreUI API Client

Taskfile.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ tasks:
2121
lint:
2222
desc: Run the linter
2323
cmds:
24-
- golangci-lint run
24+
- golangci-lint run --tests=false
2525

2626
generate:
2727
desc: Generate documentation
@@ -32,7 +32,7 @@ tasks:
3232
client:
3333
desc: Generate the SemaphoreUI API client code
3434
cmds:
35-
- swagger generate client -f https://github.com/semaphoreui/semaphore/blob/v2.10.35/api-docs.yml -t semaphoreui -A SemaphoreUI --default-scheme=https
35+
- swagger generate client -f https://raw.githubusercontent.com/semaphoreui/semaphore/refs/heads/develop/api-docs.yml -t semaphoreui -A SemaphoreUI --default-scheme=https
3636

3737
test:
3838
desc: Run unit tests

0 commit comments

Comments
 (0)