From f1fe6c89c26b48554ccf7bbc4910eab2f70e009f Mon Sep 17 00:00:00 2001 From: Jason Hall Date: Fri, 19 Jan 2024 11:50:17 -0500 Subject: [PATCH] cut releases periodically (if changes) Signed-off-by: Jason Hall --- .github/workflows/release.yaml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..3be2f77 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,33 @@ +name: release + +on: + schedule: + - cron: '0 0 * * 1' # weekly on Monday at 00:00 + workflow_dispatch: + +jobs: + release: + name: release + runs-on: ubuntu-latest + + permissions: + contents: write + + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - name: Check if any changes since last tag + id: check + run: | + git fetch --tags + if [ -z "$(git tag --points-at HEAD)" ]; then + echo "Nothing points at HEAD, bump a new tag" + echo "bump=yes" >> $GITHUB_OUTPUT + else + echo "A tag already points to head, don't bump" + echo "bump=no" >> $GITHUB_OUTPUT + fi + - name: Bump patch version and push tag + uses: mathieudutour/github-tag-action@fcfbdceb3093f6d85a3b194740f8c6cec632f4e2 # v6.1 + if: steps.check.outputs.bump == 'yes' + with: + github_token: ${{ secrets.GITHUB_TOKEN }}