Skip to content

Commit

Permalink
Move bump version to shared actions
Browse files Browse the repository at this point in the history
  • Loading branch information
cYKatherine committed Jan 22, 2024
1 parent c580ffa commit 1d95b15
Showing 1 changed file with 4 additions and 47 deletions.
51 changes: 4 additions & 47 deletions .github/workflows/release-docker-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,53 +15,10 @@ on:

jobs:
bumpVersion:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
outputs:
new_version: ${{ steps.version.outputs.new_version }}
image_tag: ${{ steps.updatePackageJson.outputs.image_tag }}
steps:
- name: Setup
id: setup
uses: IABTechLab/uid2-shared-actions/actions/shared_publish_setup@v2
with:
release_type: ${{ inputs.release_type }}

- name: Set version number
id: version
uses: IABTechLab/uid2-shared-actions/actions/version_number@v2
with:
type: ${{ inputs.release_type }}
version_number: ${{ inputs.version_number_input }}
branch_name: ${{ github.ref }}

- name: Update package.json
id: updatePackageJson
run: |
current_version=$(jq -r '.version')
new_version=${{ steps.version.outputs.new_version }}
jq --arg v "$new_version" ".version = \$v" "package.json" > tmp.json && mv tmp.json "package.json"
echo "Version number updated from $current_version to $new_version"
echo "image_tag=${{ steps.version.outputs.new_version }}" >> $GITHUB_OUTPUT
- name: Commit package.json
if: ${{ inputs.version_number_input == '' && steps.checkRelease.outputs.IS_RELEASE != 'true' }}
uses: IABTechLab/uid2-shared-actions/actions/commit_pr_and_merge@main
with:
add: 'package.json'
message: 'Released ${{ inputs.release_type }} version: ${{ steps.version.outputs.new_version }}'
secrets: inherit

- name: Commit package.json and set tag
if: ${{ inputs.version_number_input == '' && steps.checkRelease.outputs.IS_RELEASE == 'true' }}
uses: IABTechLab/uid2-shared-actions/actions/commit_pr_and_merge@main
with:
add: 'package.json'
message: 'Released ${{ inputs.release_type }} version: ${{ steps.version.outputs.new_version }}'
tag: v${{ steps.version.outputs.new_version }}
secrets: inherit
uses: IABTechLab/uid2-shared-actions/.github/workflows/shared-publish-to-docker-versioned.yaml@kcc-UID2-2674-implement-shared-publish-to-docker-versioned
with:
release_type: ${{ inputs.release_type }}
secrets: inherit

publishToUID2:
uses: IABTechLab/uid2-shared-actions/.github/workflows/shared-publish-to-docker-versioned.yaml@kcc-UID2-2674-implement-shared-publish-to-docker-versioned
Expand Down

0 comments on commit 1d95b15

Please sign in to comment.