diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6bc87c1..34725de 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,78 +1,78 @@ name: release on: workflow_dispatch: inputs: version: - description: Version to release + description: Version to release (optional) required: false skip_prepare: description: Skip preparation step (assume a release branch is ready) required: false default: false dry_run: description: Do not actually cut the release required: false default: false force: description: Force the release, bypassing the 'release-blocker' issue killswitch required: false default: false schedule: # We want the release to be at 10 or 11am Pacific Time # We also make this an hour after all others such as Sentry, # Snuba, and Relay to make sure their releases finish. - - cron: '0 18 15 * *' + - cron: "0 18 15 * *" jobs: release: runs-on: ubuntu-latest name: "Release a new version" steps: - id: killswitch if: ${{ !github.event.inputs.force }} run: | if curl -s "https://api.github.com/repos/$GITHUB_REPOSITORY/issues?state=open&labels=release-blocker" | grep -Pzvo '\[[\s\n\r]*\]'; then echo "Open release-blocking issues found, cancelling release..."; curl -sf -X POST -H 'Accept: application/vnd.github.v3+json' -H 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' https://api.github.com/repos/$GITHUB_REPOSITORY/actions/runs/${{ github.run_id }}/cancel; fi - id: calver if: ${{ !github.event.inputs.version }} run: | DATE_PART=$(date +'%y.%-m') declare -i PATCH_VERSION=0 while curl -sf -o /dev/null "https://api.github.com/repos/$GITHUB_REPOSITORY/git/ref/tags/$DATE_PART.$PATCH_VERSION"; do PATCH_VERSION+=1 done echo "::set-output name=version::$DATE_PART.$PATCH_VERSION" - uses: actions/checkout@v2 with: token: ${{ secrets.GH_SENTRY_BOT_PAT }} - uses: getsentry/craft@master if: ${{ !github.event.inputs.skip_prepare }} with: action: prepare version: ${{ github.event.inputs.version || steps.calver.outputs.version }} env: DRY_RUN: ${{ github.event.inputs.dry_run }} GIT_COMMITTER_NAME: getsentry-bot GIT_AUTHOR_NAME: getsentry-bot EMAIL: bot@getsentry.com - uses: getsentry/craft@master with: action: publish version: ${{ github.event.inputs.version || steps.calver.outputs.version }} - keep_branch: '--keep-branch' - no_merge: '--no-merge' + keep_branch: "--keep-branch" + no_merge: "--no-merge" env: DRY_RUN: ${{ github.event.inputs.dry_run }} GIT_COMMITTER_NAME: getsentry-bot GIT_AUTHOR_NAME: getsentry-bot EMAIL: bot@getsentry.com - id: bump-license-date if: ${{ !github.event.inputs.dry_run && !github.event.inputs.version }} env: GIT_COMMITTER_NAME: getsentry-bot GIT_AUTHOR_NAME: getsentry-bot EMAIL: bot@getsentry.com run: | sed -i -e "s/\(Change Date:\s*\)[-0-9]\+\$/\\1$(date +'%Y-%m-%d' -d '3 years')/" LICENSE git diff --quiet || git commit -anm 'license: Update BSL change date' && git push