From 942dbd37495869a67f97920f4ccb115598c7013b Mon Sep 17 00:00:00 2001 From: pcmagas Date: Sat, 3 Feb 2024 22:56:06 +0200 Subject: [PATCH 1/6] Check for modificed files + Licence Disclaimer --- .husky/pre-push | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.husky/pre-push b/.husky/pre-push index 0d8c0a2..b542438 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -1,3 +1,20 @@ +# +# Copyright 2024 Cypriot Free Software Foundation +# +# Permission is hereby granted, free of charge, +# to any person obtaining a copy of this software and associated documentation files (the “Software”), +# to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, +# sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +# INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + #!/bin/bash test -n "$BASH_VERSION" || exec /bin/bash $0 "$@" @@ -9,6 +26,13 @@ done current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,') +set +e + +if git status | grep -q modified; then + echo "Modified files running" + exit 0 +fi + if [ $current_branch == "dev" ]; then echo "No bump needed upon dev"git exit 0 From f70da00ba410e0a1945771045e2bdab085f5212b Mon Sep 17 00:00:00 2001 From: pcmagas Date: Sat, 3 Feb 2024 22:58:29 +0200 Subject: [PATCH 2/6] Check for modificed files + Licence Disclaimer --- .husky/pre-push | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.husky/pre-push b/.husky/pre-push index b542438..a79da4b 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -26,12 +26,7 @@ done current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,') -set +e - -if git status | grep -q modified; then - echo "Modified files running" - exit 0 -fi +git diff-index --cached HEAD if [ $current_branch == "dev" ]; then echo "No bump needed upon dev"git From f8c58142751535375b76a4300baab070b63e5994 Mon Sep 17 00:00:00 2001 From: pcmagas Date: Sat, 3 Feb 2024 22:59:44 +0200 Subject: [PATCH 3/6] Check for modificed files + Licence Disclaimer --- .husky/pre-push | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.husky/pre-push b/.husky/pre-push index a79da4b..b9a259a 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -25,11 +25,12 @@ while read local_ref local_sha remote_ref remote_sha;do done current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,') - +echo $remote_ref +echo git diff-index --cached HEAD if [ $current_branch == "dev" ]; then - echo "No bump needed upon dev"git + echo "No bump needed upon dev" exit 0 fi From dc0f4673bfaa1a861005ab985ea667752350f88f Mon Sep 17 00:00:00 2001 From: pcmagas Date: Sat, 3 Feb 2024 23:00:03 +0200 Subject: [PATCH 4/6] Check for modificed files + Licence Disclaimer --- .husky/pre-push | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.husky/pre-push b/.husky/pre-push index b9a259a..1a6b6f0 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -25,7 +25,7 @@ while read local_ref local_sha remote_ref remote_sha;do done current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,') -echo $remote_ref +echo $local_ref echo git diff-index --cached HEAD From a69f3da3ab13b797fd0c343d4db1234286b6b3c5 Mon Sep 17 00:00:00 2001 From: pcmagas Date: Sat, 3 Feb 2024 23:04:23 +0200 Subject: [PATCH 5/6] Better branch checking --- .husky/pre-push | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.husky/pre-push b/.husky/pre-push index 1a6b6f0..9f714ea 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -25,12 +25,9 @@ while read local_ref local_sha remote_ref remote_sha;do done current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,') -echo $local_ref -echo -git diff-index --cached HEAD -if [ $current_branch == "dev" ]; then - echo "No bump needed upon dev" +if [ $current_branch != "master" ]; then + echo "Ommiting version bump " exit 0 fi From 38ae002f3c4b8e7baec66253b55579dda2373411 Mon Sep 17 00:00:00 2001 From: pcmagas Date: Sat, 3 Feb 2024 23:11:15 +0200 Subject: [PATCH 6/6] Lincencing files and simplifying release --- .github/workflows/build-sass.yml | 37 ++++++++++++++------------------ .husky/pre-push | 2 +- 2 files changed, 17 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build-sass.yml b/.github/workflows/build-sass.yml index 385d1cc..bc4a65b 100644 --- a/.github/workflows/build-sass.yml +++ b/.github/workflows/build-sass.yml @@ -1,3 +1,19 @@ +# +# Copyright 2024 Cypriot Free Software Foundation +# +# Permission is hereby granted, free of charge, +# to any person obtaining a copy of this software and associated documentation files (the “Software”), +# to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, +# sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +# INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# name: "release-sass" @@ -40,17 +56,6 @@ jobs: token: ${{ secrets.MY_SECRET_TOKEN }} force: true - - - name: "Mark prelelease" - if: github.ref == 'refs/heads/dev' - run: | - npm version prerelease --preid=dev --no-commit-hooks --no-git-tag-version - - - name: "Minor Bump version" - if: github.ref == 'refs/heads/master' - run: | - npm version patch --no-commit-hooks --no-git-tag-version - - name: commit built package.json uses: actions-x/commit@v6 with: @@ -75,16 +80,6 @@ jobs: - name: Make Css zip run: | zip -r cssonly.zip ./dist/*.css - - - uses: "marvinpinto/action-automatic-releases@latest" - if: github.ref == 'refs/heads/dev' - with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: "v${{ steps.version.outputs.version }}" - prerelease: true - title: "Development Build" - files: | - cssonly.zip - uses: "marvinpinto/action-automatic-releases@latest" if: github.ref == 'refs/heads/master' diff --git a/.husky/pre-push b/.husky/pre-push index 9f714ea..ded34ea 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -27,7 +27,7 @@ done current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,') if [ $current_branch != "master" ]; then - echo "Ommiting version bump " + echo "Ommiting version bump because current branch is ${current_branch}" exit 0 fi