aboutsummaryrefslogtreecommitdiff
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 000000000..e6a1d52b3
--- /dev/null
+++ b/.github/workflows/auto_tag.yaml
@@ -0,0 +1,32 @@
1name: Essential files modified
2
3on:
4 push:
5 branches:
6 - master
7 paths:
8 - quantum/**/*
9 - tmk_core/**/*
10 - drivers/**/*
11 - tests/**/*
12 - util/**/*
13 - platforms/**/*
14 - Makefile
15 - '*.mk'
16
17jobs:
18 tag:
19 runs-on: ubuntu-latest
20
21 # protect against those who develop with their fork on master
22 if: github.repository == 'qmk/qmk_firmware'
23
24 steps:
25 - uses: actions/checkout@v2
26 with:
27 fetch-depth: 0
28
29 - name: Bump version and push tag
30 uses: anothrNick/github-tag-action@1.26.0
31 env:
32 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/util/travis_compiled_push.sh b/util/travis_compiled_push.sh
index 195a87208..a9c6f028f 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'
17git diff --diff-filter=AM --name-only -n 1 -z ${TRAVIS_COMMIT_RANGE} | xargs -0 git add 17git diff --diff-filter=AM --name-only -n 1 -z ${TRAVIS_COMMIT_RANGE} | xargs -0 git add
18git commit -m "format code according to conventions [skip ci]" && git push git@github.com:qmk/qmk_firmware.git master 18git commit -m "format code according to conventions [skip ci]" && git push git@github.com:qmk/qmk_firmware.git master
19 19
20increment_version ()
21{
22 declare -a part=( ${1//\./ } )
23 part[2]=$((part[2] + 1))
24 new="${part[*]}"
25 echo -e "${new// /.}"
26}
27
28git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} 20git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE}
29 21
30NEFM=$(git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} | grep -Ev '^(keyboards/)' | grep -Ev '^(docs/)' | grep -Ev '^(users/)' | grep -Ev '^(layouts/)' | wc -l)
31if [[ $NEFM -gt 0 ]] ; then
32 echo "Essential files modified."
33 git fetch --tags
34 lasttag=$(git tag --sort=-creatordate --no-column --list '*.*.*' | grep -E -m1 '^[0-9]+\.[0-9]+\.[0-9]+$')
35 newtag=$(increment_version $lasttag)
36 until git tag $newtag; do
37 newtag=$(increment_version $newtag)
38 done
39 git push --tags git@github.com:qmk/qmk_firmware.git
40else
41 echo "No essential files modified."
42fi
43
44if [[ "$TRAVIS_COMMIT_MESSAGE" != *"[skip build]"* ]] ; then 22if [[ "$TRAVIS_COMMIT_MESSAGE" != *"[skip build]"* ]] ; then
45 make generate-keyboards-file SILENT=true > .keyboards 23 make generate-keyboards-file SILENT=true > .keyboards
46 cd .. 24 cd ..