diff --git a/.github/scripts/prerpare_release.sh b/.github/scripts/prerpare_release.sh new file mode 100644 index 00000000..b8062d4a --- /dev/null +++ b/.github/scripts/prerpare_release.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +# Fail on first error. +set -e + +releaseLevel="$1" + +oldVersion="$(node -pe 'require("./package.json").version')" +npx standard-version --release-as "$releaseLevel" --skip.commit=true --skip.changelog=true --skip.tag=true + +cd selenium +npx standard-version --release-as "$releaseLevel" --skip.commit=true --skip.changelog=true --skip.tag=true +cd .. +newVersion="$(node -pe 'require("./package.json").version')" + + +# xmlstarlet is used to edit xml files +sudo apt-get install -y xmlstarlet + +updateXML() { + xpath="$1" + newValue="$2" + file="$3" + + # Update file inplace (--inplace) and preserve formatting (-P) + xmlstarlet edit -P --inplace --update "$xpath" --value "$newValue" "$file" +} + +versionXpath=/_:project/_:version +parentVersionXpath=/_:project/_:parent/_:version +# Reads as: Select the "version" node of the "dependency" node that has a "groupId" node which matches "com.deque.html.axe-devtools" +dequeDepVersionXpath='/_:project/_:dependencies/_:dependency[_:groupId="com.deque.html.axe-core"]/_:version' +propertiesVersionXpath=/_:project/_:properties/_:version + +updateXML "$versionXpath" "$newVersion" pom.xml + +# Update version, the version of parent, and version of any ADT deps in our ADT packages +for package in utilities selenium playwright; do + updateXML "$versionXpath" "$newVersion" "$package"/pom.xml + updateXML "$parentVersionXpath" "$newVersion" "$package"/pom.xml + # If no dep is found no change will be made + updateXML "$dequeDepVersionXpath" "$newVersion" "$package"/pom.xml +done + +npx conventional-changelog-cli -p angular -i CHANGELOG.md -s + diff --git a/.github/workflows/auto-patch-release.yml b/.github/workflows/auto-patch-release.yml new file mode 100644 index 00000000..2cd99e04 --- /dev/null +++ b/.github/workflows/auto-patch-release.yml @@ -0,0 +1,13 @@ +name: Automatically create patch release every 2 weeks +on: + schedule: + # Run every Friday right before midnight + - cron: '59 23 * * 5' +jobs: + create_patch_release: + uses: dequelabs/axe-api-team/.github/workflows/auto-patch-release.yml + secrets: inherit + with: + release-command: bash .github/scripts/prepare_release.sh + release-branch: master + default-branch: develop diff --git a/package-lock.json b/package-lock.json index eda014d0..86d7ecab 100644 --- a/package-lock.json +++ b/package-lock.json @@ -179,6 +179,12 @@ "node": ">=0.10.0" } }, + "node_modules/axe-test-fixtures": { + "version": "1.0.0", + "resolved": "git+ssh://git@github.com/dequelabs/axe-test-fixtures.git#23f638c574dd9be2a725fa81854f1560d858dcce", + "dev": true, + "license": "MPL-2.0" + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -3373,6 +3379,16 @@ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true }, + "node_modules/uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", + "dev": true, + "bin": { + "uuid": "bin/uuid" + } + }, "node_modules/validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", @@ -3644,6 +3660,11 @@ "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", "dev": true }, + "axe-test-fixtures": { + "version": "git+ssh://git@github.com/dequelabs/axe-test-fixtures.git#23f638c574dd9be2a725fa81854f1560d858dcce", + "dev": true, + "from": "git+ssh://git@github.com/dequelabs/axe-test-fixtures.git#23f638c574dd9be2a725fa81854f1560d858dcce" + }, "balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -5987,6 +6008,12 @@ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true + }, "validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",