diff --git a/.github/workflows/backport.yaml b/.github/workflows/backport.yaml new file mode 100644 index 00000000..bc0f8f7c --- /dev/null +++ b/.github/workflows/backport.yaml @@ -0,0 +1,26 @@ +name: "Backport merged pull request" +on: + pull_request: + types: [closed] + issue_comment: + types: [created] + +# Default empty permissions for all jobs +permissions: {} + +jobs: + backport: + permissions: + contents: write + pull-requests: write + id-token: write + if: | + ( + github.event_name == 'pull_request' && + github.event.pull_request.merged + ) || ( + github.event_name == 'issue_comment' && + github.event.issue.pull_request && + startsWith(github.event.comment.body, '/backport') + ) + uses: opentdf/platform/reusable_backport.yaml@main diff --git a/.github/workflows/create-release-branch.yaml b/.github/workflows/create-release-branch.yaml new file mode 100644 index 00000000..def42c8e --- /dev/null +++ b/.github/workflows/create-release-branch.yaml @@ -0,0 +1,15 @@ +name: "Create Release Branch" + +on: + release: + types: [released] + +# Default empty permissions for all jobs +permissions: {} + +jobs: + create-release-branch: + if: ${{ endsWith(github.event.release.tag_name, '.0') }} + permissions: + id-token: write + uses: opentdf/platform/reusable_create-release-branch.yaml@main diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 7352d6b1..e75d3139 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -4,6 +4,7 @@ on: push: branches: - main + - "release/**" release: types: [created] @@ -13,19 +14,10 @@ permissions: jobs: release-please: - runs-on: ubuntu-latest - steps: - - name: Generate a token - id: generate_token - uses: actions/create-github-app-token@f2acddfb5195534d487896a656232b016a682f3c # v1.9.0 - with: - app-id: "${{ secrets.APP_ID }}" - private-key: "${{ secrets.AUTOMATION_KEY }}" - - uses: googleapis/release-please-action@a02a34c4d625f9be7cb89156071d8567266a2445 # v4.2.0 - with: - token: "${{ steps.generate_token.outputs.token }}" - config-file: release-please.json - manifest-file: .release-please-manifest.json + permissions: + contents: write + pull-requests: write + uses: opentdf/platform/reusable_release-please.yaml@main release: runs-on: ubuntu-latest steps: diff --git a/release-please.json b/release-please_main-branch.json similarity index 91% rename from release-please.json rename to release-please_main-branch.json index 78f10bf8..55a6077b 100644 --- a/release-please.json +++ b/release-please_main-branch.json @@ -2,7 +2,6 @@ "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", "release-type": "maven", "bump-minor-pre-major": true, - "bump-patch-for-minor-pre-major": true, "separate-pull-requests": false, "include-component-in-tag": false, "group-pull-request-title-pattern": "chore(${branch}): release ${version}", diff --git a/release-please_release-branches.json b/release-please_release-branches.json new file mode 100644 index 00000000..6177d966 --- /dev/null +++ b/release-please_release-branches.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "release-type": "maven", + "versioning": "always-bump-patch", + "separate-pull-requests": false, + "include-component-in-tag": false, + "group-pull-request-title-pattern": "chore(${branch}): release ${version}", + "packages": { + ".": {} + }, + "extra-files": [ + { + "type": "generic", + "path": "cmdline/src/main/java/io/opentdf/platform/Command.java" + } + ] +}