diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..74b5f56 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,54 @@ +# This release drafter follows the conventions +# from https://keepachangelog.com + +name-template: 'v$RESOLVED_VERSION' +tag-template: 'v$RESOLVED_VERSION' +template: '$CHANGES' +category-template: '### $TITLE' +categories: + - title: Added + labels: + - feature + - enhancement + - title: Fixed + labels: + - fix + - bug + - title: Changed + labels: + - changed + - title: Deprecated + labels: + - deprecated + - title: Removed + labels: + - removed + - title: Security + labels: + - security + - title: Documentation + labels: + - docs + - documentation + - title: Dependency Updates + labels: + - deps + - dependencies + collapse-after: 5 + +change-template: '- $TITLE @$AUTHOR (#$NUMBER)' +change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. +version-resolver: + major: + labels: + - major + minor: + labels: + - minor + patch: + labels: + - patch + default: patch + +exclude-labels: + - skip-changelog diff --git a/.github/workflows/check-pr.yml b/.github/workflows/check-pr.yml new file mode 100644 index 0000000..96d17b7 --- /dev/null +++ b/.github/workflows/check-pr.yml @@ -0,0 +1,50 @@ +name: Label Checker + +on: + pull_request: + types: + - opened + - synchronize + - reopened + - labeled + - unlabeled + - edited + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + check_semver_labels: + name: Check Semver labels + if: github.base_ref == 'main' + runs-on: ubuntu-latest + permissions: + pull-requests: read + checks: write + steps: + - name: Check for Semver labels + uses: danielchabr/pr-labels-checker@v3.3 + with: + hasSome: major,minor,patch + githubToken: ${{ secrets.GITHUB_TOKEN }} + + check_cc_labels: + name: Check conventional commits labels + if: github.base_ref == 'main' + runs-on: ubuntu-latest + permissions: + pull-requests: read + checks: write + steps: + - uses: danielchabr/pr-labels-checker@v3.3 + with: + hasSome: feature,enhancement,fix,bug,changed,deprecated,removed,security,docs,documentation,deps,dependencies + githubToken: ${{ secrets.GITHUB_TOKEN }} + + title-checker: + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5.4.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml new file mode 100644 index 0000000..cb79486 --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -0,0 +1,21 @@ +name: Release Drafter + +on: + push: + branches: + - main + +permissions: + contents: read + +jobs: + update_release_draft: + permissions: + contents: write + pull-requests: write + runs-on: ubuntu-latest + steps: + - name: Update Release Draft + uses: release-drafter/release-drafter@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/update-changelog.yml b/.github/workflows/update-changelog.yml new file mode 100644 index 0000000..8e37c91 --- /dev/null +++ b/.github/workflows/update-changelog.yml @@ -0,0 +1,36 @@ +name: Update Changelog + +on: + release: + types: + - released + +jobs: + update: + runs-on: ubuntu-latest + + permissions: + # Give the default GITHUB_TOKEN write permission to commit and push the + # updated CHANGELOG back to the repository. + # https://github.blog/changelog/2023-02-02-github-actions-updating-the-default-github_token-permissions-to-read-only/ + contents: write + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: ${{ github.event.release.target_commitish }} + token: ${{ secrets.CRU_DEPLOY_GITHUB_TOKEN }} + + - name: Update Changelog + uses: stefanzweifel/changelog-updater-action@v1 + with: + latest-version: ${{ github.event.release.tag_name }} + release-notes: ${{ github.event.release.body }} + + - name: Commit updated CHANGELOG + uses: stefanzweifel/git-auto-commit-action@v5 + with: + branch: ${{ github.event.release.target_commitish }} + commit_message: 'docs(changelog): update changelog' + file_pattern: CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..7d8b8e4 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,17 @@ +# 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/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + + +[unreleased]: https://github.com/CruGlobal/terraform-provider-semaphoreui/compare/main...HEAD + +## [v1.0.0](https://github.com/CruGlobal/terraform-provider-semaphoreui/compare/v0.1.1...v1.0.0) - 2024-11-20 + +### Added + +- Initial release of the provider diff --git a/README.md b/README.md index ee2a716..69197d7 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,11 @@ The [SemaphoreUI Provider](https://registry.terraform.io/providers/CruGlobal/semaphoreui/latest/docs) enables [Terraform](https://terraform.io) to manage [SemaphoreUI](https://semaphoreui.com/) resources. +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. + ## WARNING 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 +Changes are currently in the `develop` branch of the SemaphoreUI project. ### SemaphoreUI API Client