Skip to content

Commit

Permalink
Merge pull request #22 from VampireChicken12/dev
Browse files Browse the repository at this point in the history
refactor: cleaned up event listener code
  • Loading branch information
VampireChicken12 authored Aug 31, 2023
2 parents 104f91b + 7118a0a commit acb90d4
Show file tree
Hide file tree
Showing 5 changed files with 437 additions and 769 deletions.
46 changes: 0 additions & 46 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,52 +21,6 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Update package.json Version
run: |
# Install Semantic Release and extract the new version
semantic_release_output=$(npx semantic-release --dry-run)
semantic_release_exit_code=$?
echo "Semantic Release exit code: $semantic_release_exit_code"
no_new_version=$(echo "$semantic_release_output" | grep -o "There are no relevant changes, so no new version is released")
echo "Grep for 'no new version' exit code: $?"
new_version=$(echo "$semantic_release_output" | grep -oP 'The next release version is \K\d+\.\d+\.\d+')
echo "Grep for 'The next release version' exit code: $?"
if [ -n "$no_new_version" ]; then
echo "No new version is released"
exit 0
fi
if [ -z "$new_version" ]; then
echo "Failed to extract the new version from Semantic Release output. Leaving the version how it is"
exit 0
fi
# Use npm version to update the package.json
npm version $new_version -m "chore(release): %s"
npm_exit_code=$?
echo "npm version exit code: $npm_exit_code"
if [ $npm_exit_code -ne 0 ]; then
echo "npm version encountered an issue. Exiting."
exit 1
fi
# Push the changes back to the repository
git push --follow-tags
git_exit_code=$?
echo "Git push exit code: $git_exit_code"
if [ $git_exit_code -ne 0 ]; then
echo "Git push encountered an issue. Exiting."
exit 1
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: ${{github.workspace}}

- name: Build Extension
run: npm run build
working-directory: ${{github.workspace}}
Expand Down
Loading

0 comments on commit acb90d4

Please sign in to comment.