From 5665e076a136db1df5738cc17218680194eb9739 Mon Sep 17 00:00:00 2001 From: Sumedh Sakdeo Date: Wed, 21 Feb 2024 13:02:52 -0800 Subject: [PATCH 1/2] Github Action to create a new tag on successful main build post PR merge [dry-run] --- .github/workflows/tag-openhouse.yml | 34 +++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/tag-openhouse.yml diff --git a/.github/workflows/tag-openhouse.yml b/.github/workflows/tag-openhouse.yml new file mode 100644 index 00000000..254af27b --- /dev/null +++ b/.github/workflows/tag-openhouse.yml @@ -0,0 +1,34 @@ +name: Bump version and push tag +on: + pull_request: + types: + - closed + branches: + - main + workflow_run: + workflows: ["Gradle Build OpenHouse"] + types: + - completed + branches: + - main + +jobs: + build: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.merge_commit_sha }} + fetch-depth: '0' + - name: Bump version and push tag + uses: anothrNick/github-tag-action@1.64.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + WITH_V: true # prefix for tag "v" + DEFAULT_BUMP: patch # major, minor, patch + DRY_RUN: false # if true, will not push tag + INITIAL_VERSION: 0.5.0 # if no tags, will use this version \ No newline at end of file From c9853b44da4cb29d182444050befbbda300fc6de Mon Sep 17 00:00:00 2001 From: Sumedh Sakdeo Date: Wed, 21 Feb 2024 13:51:53 -0800 Subject: [PATCH 2/2] bug fix master -> main --- .github/workflows/build-gradle-openhouse.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-gradle-openhouse.yml b/.github/workflows/build-gradle-openhouse.yml index 55b349af..a82484ef 100644 --- a/.github/workflows/build-gradle-openhouse.yml +++ b/.github/workflows/build-gradle-openhouse.yml @@ -3,7 +3,7 @@ name: Gradle Build OpenHouse on: push: branches: - - master + - main pull_request: types: - opened