summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2020-12-06 12:54:08 +0000
committerGitHub <noreply@github.com>2020-12-06 12:54:08 +0000
commit8d6ad23b096ed2fc4d8fd0e6781fca30b87b343f (patch)
tree49f09a6756a88414286f406a06913d1b986640eb
parenta6a12890037c706e67716e28e37432693ba17ace (diff)
downloadqmk_firmware-8d6ad23b096ed2fc4d8fd0e6781fca30b87b343f.tar.gz
qmk_firmware-8d6ad23b096ed2fc4d8fd0e6781fca30b87b343f.zip
CI: Add workflow for tagging essential modified files (#7384)
* Add workflow for tagging essential modified files * Update inline with recent actions * align rules to labeler * Update .github/workflows/auto_tag.yaml
-rw-r--r--.github/workflows/auto_tag.yaml32
-rwxr-xr-xutil/travis_compiled_push.sh22
2 files changed, 32 insertions, 22 deletions
diff --git a/.github/workflows/auto_tag.yaml b/.github/workflows/auto_tag.yaml
new file mode 100644
index 0000000000..e6a1d52b38
--- /dev/null
+++ b/.github/workflows/auto_tag.yaml
@@ -0,0 +1,32 @@
+name: Essential files modified
+
+on:
+ push:
+ branches:
+ - master
+ paths:
+ - quantum/**/*
+ - tmk_core/**/*
+ - drivers/**/*
+ - tests/**/*
+ - util/**/*
+ - platforms/**/*
+ - Makefile
+ - '*.mk'
+
+jobs:
+ tag:
+ runs-on: ubuntu-latest
+
+ # protect against those who develop with their fork on master
+ if: github.repository == 'qmk/qmk_firmware'
+
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+
+ - name: Bump version and push tag
+ uses: anothrNick/github-tag-action@1.26.0
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/util/travis_compiled_push.sh b/util/travis_compiled_push.sh
index 195a87208b..a9c6f028fb 100755
--- a/util/travis_compiled_push.sh
+++ b/util/travis_compiled_push.sh
@@ -17,30 +17,8 @@ git diff --diff-filter=AM --name-only -n 1 -z ${TRAVIS_COMMIT_RANGE} '*.c' '*.h'
git diff --diff-filter=AM --name-only -n 1 -z ${TRAVIS_COMMIT_RANGE} | xargs -0 git add
git commit -m "format code according to conventions [skip ci]" && git push git@github.com:qmk/qmk_firmware.git master
-increment_version ()
-{
- declare -a part=( ${1//\./ } )
- part[2]=$((part[2] + 1))
- new="${part[*]}"
- echo -e "${new// /.}"
-}
-
git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE}
-NEFM=$(git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} | grep -Ev '^(keyboards/)' | grep -Ev '^(docs/)' | grep -Ev '^(users/)' | grep -Ev '^(layouts/)' | wc -l)
-if [[ $NEFM -gt 0 ]] ; then
- echo "Essential files modified."
- git fetch --tags
- lasttag=$(git tag --sort=-creatordate --no-column --list '*.*.*' | grep -E -m1 '^[0-9]+\.[0-9]+\.[0-9]+$')
- newtag=$(increment_version $lasttag)
- until git tag $newtag; do
- newtag=$(increment_version $newtag)
- done
- git push --tags git@github.com:qmk/qmk_firmware.git
-else
- echo "No essential files modified."
-fi
-
if [[ "$TRAVIS_COMMIT_MESSAGE" != *"[skip build]"* ]] ; then
make generate-keyboards-file SILENT=true > .keyboards
cd ..