-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(release): Move to workflow_dispatch for UI-triggered releases
- Loading branch information
Showing
1 changed file
with
21 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,18 @@ | ||
name: release | ||
on: | ||
repository_dispatch: | ||
types: [release] | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: Version to release | ||
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 | ||
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, | ||
|
@@ -13,22 +24,22 @@ jobs: | |
name: "Release a new version" | ||
steps: | ||
- id: calver | ||
if: ${{ !github.event.client_payload.version }} | ||
if: ${{ !github.event.inputs.version }} | ||
run: | | ||
DATE_PART=$(date +'%y.%-m') | ||
PATCH_VERSION=0 | ||
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++ )) | ||
PATCH_VERSION+=1 | ||
done | ||
echo "::set-output name=version::$DATE_PART.$PATCH_VERSION" | ||
- uses: actions/checkout@v2 | ||
- uses: getsentry/craft@master | ||
if: ${{ !github.event.client_payload.skip_prepare }} | ||
if: ${{ !github.event.inputs.skip_prepare }} | ||
with: | ||
action: prepare | ||
version: ${{ github.event.client_payload.version || steps.calver.outputs.version }} | ||
version: ${{ github.event.inputs.version || steps.calver.outputs.version }} | ||
env: | ||
DRY_RUN: ${{ github.event.client_payload.dry_run }} | ||
DRY_RUN: ${{ github.event.inputs.dry_run }} | ||
GIT_COMMITTER_NAME: getsentry-bot | ||
GIT_AUTHOR_NAME: getsentry-bot | ||
EMAIL: [email protected] | ||
|
@@ -39,11 +50,11 @@ jobs: | |
- uses: getsentry/craft@master | ||
with: | ||
action: publish | ||
version: ${{ github.event.client_payload.version || steps.calver.outputs.version }} | ||
version: ${{ github.event.inputs.version || steps.calver.outputs.version }} | ||
keep_branch: '--keep-branch' | ||
no_merge: '--no-merge' | ||
env: | ||
DRY_RUN: ${{ github.event.client_payload.dry_run }} | ||
DRY_RUN: ${{ github.event.inputs.dry_run }} | ||
GIT_COMMITTER_NAME: getsentry-bot | ||
GIT_AUTHOR_NAME: getsentry-bot | ||
EMAIL: [email protected] |