Skip to content

Commit

Permalink
fix: change code 4
Browse files Browse the repository at this point in the history
  • Loading branch information
popovevgen committed Dec 27, 2023
1 parent af7ec2c commit f159a17
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,25 @@ jobs:
}
EOF
- name: Release (Dry Run)
id: get_versions
- name: Determine the New Version Number
run: |
CURRENT_VERSION=$(npx semantic-release --dry-run | grep "associated with version " | sed -E 's/.* version//' | sed -E 's/ on.*//')
NEXT_VERSION=$(npx semantic-release --dry-run | grep 'The next release version is' | sed -E 's/.* ([[:digit:].]+)$/\1/')
echo ::set-output name=current_version::$CURRENT_VERSION
echo ::set-output name=next_version::$NEXT_VERSION
echo "Current version is ${CURRENT_VERSION}"
echo "Next version is ${NEXT_VERSION}"
NEW_VERSION=$(npx semantic-release --dry-run | grep 'next release version is' | sed 's/.*is //')
echo "New version number: $NEW_VERSION"
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
if [ -z "$NEW_VERSION" ]; then
echo "::warning title=No Release::No relevant changes have been detected. The workflow will be terminated without publishing a new release."
fi
- name: Read the Current Version Number
if: env.NEW_VERSION != ''
run: |
CURRENT_VERSION=$(jq -r '.version' package.json)
echo "Current version number: $CURRENT_VERSION"
echo "CURRENT_VERSION=$CURRENT_VERSION" >> $GITHUB_ENV
- name: 'Release'
if: env.NEW_VERSION != '' && env.NEW_VERSION != env.CURRENT_VERSION
run: npx semantic-release --ci --debug
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit f159a17

Please sign in to comment.