Skip to content

Commit

Permalink
Added GitHub action to verify major and minor versions
Browse files Browse the repository at this point in the history
  • Loading branch information
simonkarman committed Oct 9, 2024
1 parent 8cea811 commit 9474918
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 4 deletions.
1 change: 0 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- main
- 0.6.0

concurrency:
group: "publish"
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Verify major and minor versions

on: push

defaults:
run:
shell: bash

jobs:
version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check versions
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
echo "Verifying that all packages have the same major and minor version (patch version can be different)..."
version_base=$(cat package.json | jq '.version' --raw-output)
version_base=${version_base%.*}
echo "Base Version: $version_base"
find . -name "package.json" -type f -not -path "*/node_modules/*" -not -path "*/.next/*" -not -path "*/state/*" | sort | while read -r file; do
name_pkg=$(cat $file | jq '.name' --raw-output)
version_pkg=$(cat $file | jq '.version' --raw-output)
version_pkg="${version_pkg%.*}"
if [ "$version_base" != "$version_pkg" ]; then
echo "$name_pkg: $version_pkg (mismatch!)"
exit 1
else
echo "$name_pkg: \xE2\x9C\x94"
fi
done
4 changes: 2 additions & 2 deletions docs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@krmx/docs",
"description": "krmx documentation",
"author": "Simon Karman",
"version": "0.4.0",
"version": "0.6.0",
"private": true,
"scripts": {
"dev": "next",
Expand Down

0 comments on commit 9474918

Please sign in to comment.