From aa46570d791167b60ee6793739305dc1d6535ce5 Mon Sep 17 00:00:00 2001 From: "Cole (Mike) Winberry" Date: Sat, 18 May 2024 11:57:33 -0700 Subject: [PATCH 1/5] chore(actions): add release-please.yaml and initial config --- .github/workflows/release-please.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/release-please.yaml diff --git a/.github/workflows/release-please.yaml b/.github/workflows/release-please.yaml new file mode 100644 index 00000000..d35d86d9 --- /dev/null +++ b/.github/workflows/release-please.yaml @@ -0,0 +1,18 @@ +name: Lula Draft Release(please) + +on: + push: + branches: + - main + +jobs: + tag-new-version: + name: Tag New Version + permissions: + contents: write + pull-requests: write + runs-on: ubuntu-latest + steps: + - name: Create release tag + id: tag + uses: googleapis/release-please-action@f3969c04a4ec81d7a9aa4010d84ae6a7602f86a7 \ No newline at end of file From 3630cd6a9f1049f5a2f91715a345ab554f2dedd1 Mon Sep 17 00:00:00 2001 From: "Cole (Mike) Winberry" Date: Sat, 18 May 2024 12:05:46 -0700 Subject: [PATCH 2/5] chore(actions): add release please manifest with current lula version chore(actions): set gorelease draft to false --- .goreleaser.yaml | 2 +- .release-please-manifest.json | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 .release-please-manifest.json diff --git a/.goreleaser.yaml b/.goreleaser.yaml index ba61e909..adb5fe51 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -49,4 +49,4 @@ release: name: lula prerelease: auto mode: append - draft: true + draft: false diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 00000000..63065011 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.2.1" +} \ No newline at end of file From 31c152f75f11552230624267d9dfb929c4c1a512 Mon Sep 17 00:00:00 2001 From: "Cole (Mike) Winberry" Date: Sat, 18 May 2024 12:21:15 -0700 Subject: [PATCH 3/5] chore(actions): add PR title linting for conventional commits --- .github/workflows/commitlint.yaml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/commitlint.yaml diff --git a/.github/workflows/commitlint.yaml b/.github/workflows/commitlint.yaml new file mode 100644 index 00000000..adfc6830 --- /dev/null +++ b/.github/workflows/commitlint.yaml @@ -0,0 +1,27 @@ +name: PR Title Check + +on: + pull_request: + branches: [main] + types: [opened, edited, synchronize] + +jobs: + title_check: + runs-on: ubuntu-latest + permissions: + pull-requests: read + + steps: + - name: Checkout + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + with: + fetch-depth: 0 + + - name: Setup Node.js + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + + - name: Install commitlint + run: npm install --save-dev @commitlint/{config-conventional,cli} + + - name: Lint PR title + run: echo "${{ github.event.pull_request.title }}" | npx commitlint \ No newline at end of file From 29d1169d6a2e4268bfac4ffe807d080659b9423e Mon Sep 17 00:00:00 2001 From: "Cole (Mike) Winberry" Date: Sat, 18 May 2024 12:40:17 -0700 Subject: [PATCH 4/5] chore(actions): #420 add commitlint config --- commitlint.config.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 commitlint.config.js diff --git a/commitlint.config.js b/commitlint.config.js new file mode 100644 index 00000000..8567d51d --- /dev/null +++ b/commitlint.config.js @@ -0,0 +1 @@ +module.exports = { extends: ["@commitlint/config-conventional"] }; \ No newline at end of file From 94988d6289802fce43880c80620b9f02f8aba12d Mon Sep 17 00:00:00 2001 From: "Cole (Mike) Winberry" Date: Sat, 18 May 2024 12:57:26 -0700 Subject: [PATCH 5/5] chore(docs): update release-process docs with new implementation chor(actions): add the release-please-config.json from go-oscal --- docs/release-process.md | 37 ++++--------------------------------- release-please-config.json | 28 ++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 33 deletions(-) create mode 100644 release-please-config.json diff --git a/docs/release-process.md b/docs/release-process.md index 37f55ff7..0dc64c6f 100644 --- a/docs/release-process.md +++ b/docs/release-process.md @@ -4,11 +4,11 @@ This document provides guidance on how to create Lula releases, address release ## Creating releases -This project uses [goreleaser](https://github.com/goreleaser/goreleaser-action) for releasing binaries. +This project uses [goreleaser](https://github.com/goreleaser/goreleaser-action) for releasing binaries and [release-please](https://github.com/marketplace/actions/release-please-action) for creating release PR's. ### How should I write my commits? -We use conventional commit messages [Conventional Commit messages](https://www.conventionalcommits.org/). +We use conventional commit messages [Conventional Commit messages](https://www.conventionalcommits.org/). The most important prefixes you should have in mind are: @@ -20,15 +20,8 @@ The most important prefixes you should have in mind are: ### How can I influence the version number for a release? -To trigger the goreleaser action you push a signed tag using your GPG key. - -```console -git tag -s vX.X.X -m "Release Commit Message" - -git push origin vX.X.X -``` - -Goreleaser can also be triggered by cutting the release manually through GitHub. Following the GitHub [release](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository) documentation and using a semver version number IE. vX.X.X +PR titles should also follow this pattern and are linted using [commitlint](https://commitlint.js.org/). The PR title will determine the version bump. When a PR is merged (squashed) release-please will kick off a release PR. When that release PR is approved and merged, release-please will create a draft release. Once that draft release is published go-releaser with build and publish the assets. +* Pre-v1.0.0 release-please is configured to bump minors on breaking changes and patches otherwise. per [release-please-config](../release-please-config.json) ### How do I fix a release issue? @@ -47,28 +40,6 @@ The CHANGELOG is not required to be updated, only the release notes must be upda >PLEASE USE A NEWER VERSION (there are known issues with this release) ``` -#### Incorrect Tag or Remove a Tag - -In the event a release is tagged incorrectly and it needs to be changed this can be completed by someone with admin privileges in the repo by running the following commands: - -```console -git tag -d vX.X.X - -git tag -s vX.X.X - -git push origin vX.X.X --force -``` - -These commands will delete the tag locally, create a new signed tag version, lastly force push the new tag to origin. - -In the event a tag needs deleted and NOT replaced this can be completed by someone with admin privileges in the repo by running the following commands: - -```console -git tag -d vX.X.X - -git push origin :refs/tags/vX.X.X -``` - #### Other issues and helpful tips - Confirm that the goreleaser configuration is valid by using the [goreleaser cli](https://goreleaser.com/cmd/goreleaser_check/?h=valid) diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 00000000..5f600b20 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,28 @@ +{ + "packages": { + ".": { + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": true, + "release-type": "go", + "draft": true, + "changelog-path": "CHANGELOG.md", + "changelog-sections": [ + { + "type": "feat", + "section": "Features", + "hidden": false + }, + { + "type": "fix", + "section": "Bug Fixes", + "hidden": false + }, + { + "type": "chore", + "section": "Miscellaneous", + "hidden": false + } + ] + } + } +} \ No newline at end of file