-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: auto patch-release every 2 weeks (#318)
- Loading branch information
1 parent
03ca823
commit d88406d
Showing
3 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.