From f521e9a800eecb686f727ed041f338bc807859ce Mon Sep 17 00:00:00 2001 From: Simon Steinbeiss Date: Fri, 18 Mar 2022 15:50:15 +0100 Subject: [PATCH] Enable scheduled upstream releases Instead of a human pushing a tag with the release notes let a bot do the work. The bot is part of our composite action in osbuild/release-action on the create-tag branch. It calculates the next subsequent release version and creates a tag based on pull request titles associated with the changes since the last release. Finally the tag is pushed to the repository. Unfortunately GH Actions don't allow for reliably fortnightly schedules, so we do an additional check that determines if this is an even or an odd week. This will help with correctly scheduling alternating osbuild and osbuild-composer releases. --- .github/workflows/create-tag.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/create-tag.yml diff --git a/.github/workflows/create-tag.yml b/.github/workflows/create-tag.yml new file mode 100644 index 000000000..e775e8441 --- /dev/null +++ b/.github/workflows/create-tag.yml @@ -0,0 +1,24 @@ +# This action creates a release every second Wednesday +name: "Create and push release tag" + +on: + workflow_dispatch: + schedule: + - cron: "0 10 * * 3" + +jobs: + tag-and-push: + runs-on: ubuntu-latest + + steps: + - name: Even or odd week + run: if [ `expr \`date +\%s\` / 86400 \% 2` -eq 0 ]; then echo "WEEK='odd'" >> $GITHUB_ENV; else echo "WEEK='even'" >> $GITHUB_ENV; fi + shell: bash + + - name: Upstream tag + uses: osbuild/release-action@create-tag + if: ${{ env.WEEK == 'even' }} + with: + token: "${{ secrets.SCHUTZBOT_GITHUB_ACCESS_TOKEN }}" + username: "imagebuilder-bot" + email: "imagebuilder-bots+imagebuilder-bot@redhat.com"