From 35e0aa55e511175dfd69f48f1c012828c3354409 Mon Sep 17 00:00:00 2001 From: polyfloyd Date: Sun, 21 Jan 2024 00:06:25 +0100 Subject: [PATCH] ci: Main CI should be workflow_call'able --- .github/workflows/bump.yml | 34 ++++++++++++++++++++++++++ .github/workflows/{main.yml => ci.yml} | 1 + 2 files changed, 35 insertions(+) create mode 100644 .github/workflows/bump.yml rename .github/workflows/{main.yml => ci.yml} (97%) diff --git a/.github/workflows/bump.yml b/.github/workflows/bump.yml new file mode 100644 index 0000000..f5a8178 --- /dev/null +++ b/.github/workflows/bump.yml @@ -0,0 +1,34 @@ +name: Bump + +on: + workflow_dispatch: + +jobs: + + ci: + uses: ./.github/workflows/ci.yml + + bump: + runs-on: ubuntu-latest + + needs: + - ci + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + ssh-key: "${{ secrets.DEPLOY_SSH_KEY }}" + - run: pip3 install Commitizen==3.12.0 setuptools-scm>=8.0 + + - run: git config --local user.email "github-actions@users.noreply.github.com" + - run: git config --local user.name "github-actions" + + - name: Get new version + run: echo "NEW_VERSION=$(cz bump --dry-run | grep -Po 'v\K([0-9]+(\.[0-9]+)+)')" >> $GITHUB_ENV + - name: Update Cargo.toml + run: sed -i 's/^version =.\+$/version = "${{ env.NEW_VERSION }}"/' Cargo.toml + - run: cz bump --changelog + + - run: git push + - run: git push --tags diff --git a/.github/workflows/main.yml b/.github/workflows/ci.yml similarity index 97% rename from .github/workflows/main.yml rename to .github/workflows/ci.yml index 101a376..a021a81 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,7 @@ on: pull_request: branches: - main + workflow_call: jobs: