Skip to content

Release v0.3.0

Release v0.3.0 #10

Workflow file for this run

on:
pull_request:
branches:
- master
jobs:
check-pr-version:
runs-on: ubuntu-latest
steps:
- name: Checkout PR branch
uses: actions/checkout@v3
- name: Get version from PR branch
id: pr_version
run: |
PR_VERSION=$(grep '<Version>' **/*.csproj | sed -E 's/.*<Version>(.*)<\/Version>.*/\1/')
echo "PR_VERSION=$PR_VERSION" >> $GITHUB_ENV
- name: Checkout master branch
run: |
git fetch origin master
git checkout origin/master
- name: Get version from master branch
id: master_version
run: |
MASTER_VERSION=$(grep '<Version>' **/*.csproj | sed -E 's/.*<Version>(.*)<\/Version>.*/\1/')
echo "MASTER_VERSION=$MASTER_VERSION" >> $GITHUB_ENV
- name: Compare versions
run: |
if [ "$(printf '%s\n' "$PR_VERSION" "$MASTER_VERSION" | sort -V | head -n1)" = "$PR_VERSION" ] && [ "$PR_VERSION" != "$MASTER_VERSION" ]; then
echo "Version in PR is not higher than master."
exit 1
else
echo "Version in PR is higher than master."
fi