Feature/verify new version on pr to master #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
pull_request: | |
branches: | |
- master | |
jobs: | |
verify-version: | |
name: Verify version | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Get current SDK version - pom | |
id: new-version | |
run: | | |
echo "project=$( mvn help:evaluate -Dexpression=project.version -q -DforceStdout )" >> "$GITHUB_OUTPUT" && \ | |
echo "px_metadata=$( cat px_metadata.json | jq '.version' )" >> "$GITHUB_OUTPUT" && \ | |
echo "demo_app_dependency=$( mvn help:evaluate -Dexpression=com.perimeterx.version -q -DforceStdout -f web/pom.xml)" >> "$GITHUB_OUTPUT" | |
- name: Verify same version in all | |
run: | | |
test $PROJECT_VERSION = $PX_METADATA_VERSION && \ | |
test $PROJECT_VERSION = $DEMO_APP_DEPENDENCY_VERSION | |
env: | |
PROJECT_VERSION: ${{ steps.new-version.outputs.project }} | |
PX_METADATA_VERSION: ${{ steps.new-version.outputs.px_metadata }} | |
DEMO_APP_DEPENDENCY_VERSION: ${{ steps.new-version.outputs.demo_app_dependency }} | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.base_ref }} | |
- name: Get base SDK version | |
id: base-version | |
run: echo "project=$( mvn help:evaluate -Dexpression=project.version -q -DforceStdout )" >> "$GITHUB_OUTPUT" | |
- name: Verify version increase | |
run: ./ci_files/verify-version-inc.sh $BASE_VERSION $NEW_VERSION | |
env: | |
NEW_VERSION: ${{ steps.new-version.outputs.project }} | |
BASE_VERSION: ${{ steps.base-version.outputs.project }} | |