Skip to content

Commit

Permalink
ci: refactor manual deployment CI config into 1 workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
levibostian committed Sep 25, 2023
1 parent b6078c0 commit 265c0d7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 108 deletions.
23 changes: 22 additions & 1 deletion .github/workflows/deploy-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ on:
push:
branches: [beta, main] # all branches where deployments currently occur. Make sure this list matches list of branches in `.releaserc` file.

workflow_dispatch: # manually run this workflow. convenient way to retry a deployment.
inputs:
existing-git-tag:
description: 'Type name of existing git tag (example: 1.0.3) to checkout and manually deploy'
required: true
type: string

permissions:
contents: write # access to push the git tag
issues: write # Bot creates an issue if there is an issue during deployment process
Expand All @@ -16,6 +23,7 @@ jobs:
name: Deploy git tag
runs-on: ubuntu-latest
outputs:
new_release_git_head: ${{ steps.semantic-release.outputs.new_release_git_head }}
new_release_published: ${{ steps.semantic-release.outputs.new_release_published }}
new_release_version: ${{ steps.semantic-release.outputs.new_release_version }}
steps:
Expand Down Expand Up @@ -125,9 +133,22 @@ jobs:
deploy-sonatype:
name: Deploy SDK to Maven Central
needs: [deploy-git-tag]
if: needs.deploy-git-tag.outputs.new_release_published == 'true' # only run if a git tag was made.
# Only run if we can find a git tag to checkout.
if: ${{ needs.deploy-git-tag.outputs.new_release_published == 'true' || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
steps:
- name: Checkout git tag that got created in previous step
uses: actions/checkout@v4
if: ${{ needs.deploy-git-tag.outputs.new_release_published == 'true' }}
with:
ref: ${{ needs.deploy-git-tag.outputs.new_release_git_head }}

- name: Checkout git tag that was previously created
uses: actions/checkout@v4
if: ${{ github.event_name == 'workflow_dispatch' }}
with:
ref: ${{ inputs.existing-git-tag }}

- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
Expand Down
107 changes: 0 additions & 107 deletions .github/workflows/manual-deployment.yml

This file was deleted.

0 comments on commit 265c0d7

Please sign in to comment.