Skip to content

Tag and Publish

Tag and Publish #25

name: Tag and Publish
on:
workflow_dispatch:
# Inputs the workflow accepts.
inputs:
jiraId:
# Friendly description to be shown in the UI instead of 'name'
description: 'Jira ID'
# Default value if no value is explicitly provided
default: 'AJ-###'
# Input has to be provided for the workflow to run
required: true
# The data type of the input
type: string
jobs:
tag-job:
runs-on: ubuntu-latest
outputs:
new_tag: ${{ steps.tag.outputs.tag }}
steps:
- name: Checkout current code
uses: actions/checkout@v4
with:
token: ${{ secrets.BROADBOT_TOKEN }} # this allows the push to succeed later
- name: Bump the tag to a new version
# https://github.com/DataBiosphere/github-actions/tree/master/actions/bumper
uses: databiosphere/github-actions/actions/bumper@bumper-0.4.0
id: tag
env:
GITHUB_TOKEN: ${{ secrets.BROADBOT_TOKEN }}
DEFAULT_BUMP: minor
FORCE_WITHOUT_CHANGES: true
RELEASE_BRANCHES: main
VERSION_FILE_PATH: build.gradle
VERSION_LINE_MATCH: "^\\s*version\\s*=\\s*'.*'"
VERSION_SUFFIX: SNAPSHOT
# Publish Python client to PyPI
python-client-job:
needs: tag-job
uses: ./.github/workflows/release-python-client.yml
with:
new-tag: ${{ needs.tag-job.outputs.new_tag }}
secrets:
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
# Publish Java client to Artifactory
java-client-job:
needs: tag-job
uses: ./.github/workflows/publish-java-client.yml
secrets:
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
# Publish Docker image to Google and Azure Container Registries
docker-image-job:
needs: tag-job
uses: ./.github/workflows/publish-docker.yml
with:
new-tag: ${{ needs.tag-job.outputs.new_tag }}
secrets:
ACR_SP_PASSWORD: ${{ secrets.ACR_SP_PASSWORD }}
ACR_SP_USER: ${{ secrets.ACR_SP_USER }}
# Publish GitHub Release
release-job:
needs: tag-job
permissions:
# write permission is required to create a github release
contents: write
# write permission is required for autolabeler
# otherwise, read permission is required at least
pull-requests: read
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v6
with:
# override release-drafter's version calculation to use the version generated by bumper
version: '${{ needs.tag-job.outputs.new_tag }}'
# publish the release; it is no longer draft
publish: true
config-name: release-drafter-config.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Publish new version to DSP infrastructure
publish-app-version-job:
needs: [tag-job, docker-image-job]
uses: ./.github/workflows/publish-app-version.yml
with:
new-tag: ${{ needs.tag-job.outputs.new_tag }}
jiraId: ${{ inputs.jiraId }}
secrets:
BROADBOT_TOKEN: ${{ secrets.BROADBOT_TOKEN }}