Skip to content

Commit

Permalink
DAT-13730: script to publish major.minor tags even when we release ma…
Browse files Browse the repository at this point in the history
…jor.minor.patch versions
  • Loading branch information
Sayali M authored and Sayali M committed Mar 1, 2023
1 parent a7bf370 commit f8223fc
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ on:
workflow_dispatch:
inputs:
liquibaseVersion:
description: 'Liquibase Version'
description: "Liquibase Version"

This comment has been minimized.

Copy link
@sayaliM0412

sayaliM0412 Mar 2, 2023

Contributor

the yaml formatter suggested these changes

required: true
extensionVersion:
description: 'Container Version (Defaults to Liquibase Version)'
description: "Container Version (Defaults to Liquibase Version)"
required: false

env:
Expand All @@ -21,18 +21,29 @@ jobs:
outputs:
liquibaseVersion: ${{ steps.collect-data.outputs.liquibaseVersion }}
extensionVersion: ${{ steps.collect-data.outputs.extensionVersion }}
minorVersion: ${{ steps.collect-data.outputs.minorVersion }}
steps:
- name: Collect Data
id: collect-data
uses: actions/github-script@v4
with:
script: |
const getMinorVersion = (liquibaseVersion) => {
const arr = liquibaseVersion.split(".")
return `${arr[0]}.${arr[1]}`
}
if (context.payload.client_payload) {
core.setOutput("liquibaseVersion", context.payload.client_payload.liquibaseVersion);
core.setOutput("extensionVersion", context.payload.client_payload.liquibaseVersion);
const liquibaseVersion = context.payload.client_payload.liquibaseVersion
const minorVersion = getMinorVersion(liquibaseVersion)
core.setOutput("liquibaseVersion", liquibaseVersion);
core.setOutput("extensionVersion", liquibaseVersion);
core.setOutput("minorVersion", minorVersion);
} else if (context.payload.inputs) {
core.setOutput("liquibaseVersion", context.payload.inputs.liquibaseVersion);
core.setOutput("extensionVersion", context.payload.inputs.extensionVersion || context.payload.inputs.liquibaseVersion);
const liquibaseVersion = context.payload.inputs.liquibaseVersion
const minorVersion = getMinorVersion(liquibaseVersion)
core.setOutput("liquibaseVersion", liquibaseVersion);
core.setOutput("extensionVersion", context.payload.inputs.extensionVersion || liquibaseVersion);
core.setOutput("minorVersion", minorVersion);
} else {
core.setFailed('Unknown event type')
}
Expand All @@ -56,8 +67,8 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
java-version: "8"
distribution: "adopt"

- name: Configure git user
run: |
Expand Down Expand Up @@ -88,7 +99,7 @@ jobs:
run: echo ::set-output name=releaseSha::$(git rev-parse HEAD)

draft-release:
needs: [ setup, update ]
needs: [setup, update]
name: Draft Release
runs-on: ubuntu-latest
steps:
Expand All @@ -106,7 +117,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-and-push:
needs: [ setup, draft-release ]
needs: [setup, draft-release]
runs-on: ubuntu-latest
name: Build and Push
steps:
Expand All @@ -121,4 +132,4 @@ jobs:
with:
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ env.IMAGE_NAME }}:latest,${{ env.IMAGE_NAME }}:${{ needs.setup.outputs.extensionVersion }}
tags: ${{ env.IMAGE_NAME }}:latest,${{ env.IMAGE_NAME }}:${{ needs.setup.outputs.extensionVersion }},${{ env.IMAGE_NAME }}:${{ needs.setup.outputs.minorVersion }}

0 comments on commit f8223fc

Please sign in to comment.