From 7efe1ca346e554ef38f6e011fd289c2607edbf5b Mon Sep 17 00:00:00 2001 From: Chris Tran Date: Tue, 19 Nov 2024 12:29:54 -0600 Subject: [PATCH 1/3] chore: bootstrap releases for path: . (#102) --- .release-please-manifest.json | 3 +++ release-please-config.json | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 .release-please-manifest.json create mode 100644 release-please-config.json diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..3d1bf0a --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "1.11.2" +} \ No newline at end of file diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..5a4ce39 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,16 @@ +{ + "packages": { + ".": { + "changelog-path": "CHANGELOG.md", + "release-type": "go", + "bump-minor-pre-major": false, + "bump-patch-for-minor-pre-major": false, + "draft": false, + "prerelease": false, + "extra-files": [ + "version.txt" + ] + } + }, + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json" +} \ No newline at end of file From a12566ba9e02eafd6749ccca55834a19d08df814 Mon Sep 17 00:00:00 2001 From: Chris Tran Date: Tue, 19 Nov 2024 12:30:56 -0600 Subject: [PATCH 2/3] ci: add release workflow (#103) * chore: bootstrap releases for path: . * ci: add release please workflow --- .github/workflows/release.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..afcddb3 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,35 @@ +name: Release + +on: + workflow_dispatch: + push: + branches: + - main + +permissions: + contents: write + pull-requests: write + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: googleapis/release-please-action@v4 + id: release + - uses: actions/checkout@v4 + if: ${{ steps.release.outputs.release_created }} + # https://github.com/googleapis/release-please-action?tab=readme-ov-file#creating-majorminor-tags + - name: Tag versions + if: ${{ steps.release.outputs.release_created }} + run: | + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com + git remote add gh-token "https://${{ secrets.GITHUB_TOKEN }}@github.com/googleapis/release-please-action.git" + git tag -d v${{ steps.release.outputs.major }} || true + git tag -d v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true + git push origin :v${{ steps.release.outputs.major }} || true + git push origin :v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true + git tag -a v${{ steps.release.outputs.major }} -m "Release v${{ steps.release.outputs.major }}" + git tag -a v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} -m "Release v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}" + git push origin v${{ steps.release.outputs.major }} + git push origin v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} From ca1749494ec3c9b4f7f38aab82eddd5ecbef90af Mon Sep 17 00:00:00 2001 From: Chris Tran Date: Tue, 19 Nov 2024 12:31:40 -0600 Subject: [PATCH 3/3] ci: adds release as ci (#104) * chore: bootstrap releases for path: . * ci: add release please workflow * ci: add release as workflow --- .github/workflows/release-as.yml | 38 ++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 1 + 2 files changed, 39 insertions(+) create mode 100644 .github/workflows/release-as.yml diff --git a/.github/workflows/release-as.yml b/.github/workflows/release-as.yml new file mode 100644 index 0000000..97c0a87 --- /dev/null +++ b/.github/workflows/release-as.yml @@ -0,0 +1,38 @@ +name: Release As + +on: + workflow_dispatch: + inputs: + version: + description: 'Major.Minor.Patch' + required: true + +jobs: + release-as: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Get latest tag + id: latest-tag + run: echo "tag=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT + - uses: jackbilestech/semver-compare@1.0.4 + with: + head: ${{ inputs.version }} + base: ${{ steps.latest-tag.outputs.tag }} + operator: '>' + # https://github.com/googleapis/release-please?tab=readme-ov-file#how-do-i-change-the-version-number + - name: Release as + run: | + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com + git switch -c release-as-v${{ github.event.inputs.version }} + git commit --allow-empty -m "chore: release ${{ github.event.inputs.version }}" -m "Release-As: ${{ github.event.inputs.version }}" + git push origin release-as-v${{ github.event.inputs.version }} + gh pr create --title "chore: Release as v${{ github.event.inputs.version }}" --body "Release as v${{ github.event.inputs.version }}" --base main + gh pr merge --squash --delete-branch + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + call-release-workflow: + needs: release-as + uses: ./.github/workflows/release.yml + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index afcddb3..64e024d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,6 +2,7 @@ name: Release on: workflow_dispatch: + workflow_call: push: branches: - main