From 38f75cd2190d739918eb97878dc27c821cf6aa4c Mon Sep 17 00:00:00 2001 From: charlie-foxtrot <13514783+charlie-foxtrot@users.noreply.github.com> Date: Sun, 21 Jan 2024 13:20:10 -0800 Subject: [PATCH] add workflow to bump version (#451) --- .github/workflows/build.yml | 3 ++- .github/workflows/version_bump.yml | 38 ++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/version_bump.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 415ecb1..2321dec 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,10 +1,11 @@ -name: Test build +name: Run CI on: push: branches: [main, unstable] tags: ['v*'] pull_request: + workflow_dispatch: schedule: - cron: '39 13 * * *' # run daily diff --git a/.github/workflows/version_bump.yml b/.github/workflows/version_bump.yml new file mode 100644 index 0000000..23e8726 --- /dev/null +++ b/.github/workflows/version_bump.yml @@ -0,0 +1,38 @@ +name: Bump version +on: + pull_request: + types: + - closed + branches: + - main +jobs: + build: + if: github.event.pull_request.merged == true + runs-on: ubuntu-22.04 + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.merge_commit_sha }} + fetch-depth: '0' + + - name: Bump version and push tag + id: tag + uses: anothrNick/github-tag-action@1.64.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + WITH_V: true + DEFAULT_BUMP: patch + + - name: Run CI on ${{ steps.tag.outputs.new_tag }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh workflow run build.yml --ref ${{ steps.tag.outputs.new_tag }} + + - name: Build and Publish Containers for ${{ steps.tag.outputs.new_tag }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh workflow run build_containers.yml --ref ${{ steps.tag.outputs.new_tag }}