Skip to content

Commit

Permalink
Merge pull request #265 from syed-salman-technoforte/1.2.0-rc2
Browse files Browse the repository at this point in the history
[MOSIP-19883] Adding workflow for release changes
  • Loading branch information
ckm007 authored Feb 4, 2022
2 parents 019e18e + 8d60e70 commit 4f976b4
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/push_trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ name: Maven Package upon a push
on:
push:
branches:
- '!release-branch'
- release-1*
- master
- 1.*
- develop
Expand Down Expand Up @@ -79,6 +81,7 @@ jobs:


publish_to_nexus:
if: "!contains(github.ref, 'master')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -176,7 +179,11 @@ jobs:
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
echo "push version ${{steps.getPomVersion.outputs.info}}"
VERSION=$BRANCH_NAME
if [[ $BRANCH_NAME == master ]]; then
VERSION=latest
else
VERSION=$BRANCH_NAME
fi
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $SERVICE_NAME $IMAGE_ID:$VERSION
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/release_changes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Release/pre-release Preparation.

on:
workflow_dispatch:
inputs:
message:
description: 'Triggered for release or pe-release'
required: false
default: 'Release Preparation'
releaseTags:
description: 'tag to update'
required: true
snapshotTags:
description: 'tag to be replaced'
required: true
base:
description: 'base branch for PR'
required: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup branch and env
run: |
# Strip git ref prefix from version
echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV
echo "GPG_TTY=$(tty)" >> $GITHUB_ENV
- name: Mannualy changing the pom versions
run: find . -type f -name "*pom.xml" -print0 | xargs -0 sed -i "s/${{ github.event.inputs.snapshotTags }}/${{ github.event.inputs.releaseTags }}/g"

- name: Updating the Release URL in POM
run: |
cd .github/workflows
sed -i 's/OSSRH_SNAPSHOT_URL/RELEASE_URL/g' push_trigger.yml
- name: Updating libs-snapshot-local to libs-release local for artifactory URL's.
run: find . -type f -name "*Dockerfile" -print0 | xargs -0 sed -i "s/libs-snapshot-local/libs-release-local/g"

- name: removing -DskipTests
run: find . -type f -name "*push_trigger.yml" -print0 | xargs -0 sed -i "s/"-DskipTests"//g"

# - name: removing --Dgpg.skip
# run: find . -type f -name "*push_trigger.yml" -print0 | xargs -0 sed -i "s/"-Dgpg.skip"//g"

- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.ACTION_PAT }}
commit-message: Updated Pom versions for release changes
title: Release changes
body: Automated PR for ${{ github.event.inputs.releaseTags }} release.
branch: release-branch
delete-branch: true
base: ${{ github.event.inputs.base }}

0 comments on commit 4f976b4

Please sign in to comment.