From d24b51012fd563c33ac9dad23598a2a656362011 Mon Sep 17 00:00:00 2001 From: Adam Cutler Date: Thu, 7 Sep 2023 16:07:30 -0400 Subject: [PATCH] ci: enable manual run of patch release (#321) --- .github/scripts/prepare_release.sh | 12 ++++++++++++ .github/workflows/auto-patch-release.yml | 12 ++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 .github/scripts/prepare_release.sh diff --git a/.github/scripts/prepare_release.sh b/.github/scripts/prepare_release.sh new file mode 100644 index 00000000..594f5e21 --- /dev/null +++ b/.github/scripts/prepare_release.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Fail on first error. +set -e + +releaseLevel="$1" + +oldVersion="$(node -pe 'require("./package.json").version')" +npx standard-version --release-as "$releaseLevel" --skip.commit=true --skip.tag=true +newVersion="$(node -pe 'require("./package.json").version')" + +sed -i -e "s/ VERSION\\s*=\\s*\"$oldVersion\"/ VERSION = \"$newVersion\"/" version.rb diff --git a/.github/workflows/auto-patch-release.yml b/.github/workflows/auto-patch-release.yml index 8e5b4f43..84ee5cf1 100644 --- a/.github/workflows/auto-patch-release.yml +++ b/.github/workflows/auto-patch-release.yml @@ -1,17 +1,25 @@ name: Automatically create patch release every 2 weeks on: schedule: - # Run every Friday right before midnight - - cron: '59 23 * * 5' + # Run every Thursday right before midnight + - cron: '59 23 * * 4' + workflow_dispatch: jobs: create_patch_release: name: Create release runs-on: ubuntu-latest steps: + - name: Determine if we skip cancel checks + id: skip-checks + shell: bash + # Skip checks if we are not a scheduled run + run: echo value=$(test ${{ github.event_name }} != schedule && echo true || echo false) >> "$GITHUB_OUTPUT" + - name: Create release uses: dequelabs/axe-api-team-public/.github/actions/auto-patch-release-v1@main with: token: ${{ secrets.GITHUB_TOKEN }} + skip_checks: ${{ steps.skip-checks.outputs.value }} project_token: ${{ secrets.GH_PROJECT_TOKEN }} slack_webhook: ${{ secrets.SLACK_WEBHOOK }} odd_release: 'true'