-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add auto-update versions workflow
The new workflow added in `.github/workflows/auto-update-versions.yml` takes care of automatically updating the Vespa version in the project's documentation. The workflow is triggered either manually or on a daily schedule, and it fetches the latest Vespa version from the Maven repository and updates the relevant files in the repository.
- Loading branch information
1 parent
7d447d8
commit 366cc32
Showing
2 changed files
with
57 additions
and
6 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,52 @@ | ||
name: Auto-update versions | ||
# | ||
# Takes care of updating the Vespa version in the documentation. | ||
# | ||
|
||
on: | ||
workflow_dispatch: # Allow manual triggering of the workflow | ||
|
||
schedule: | ||
- cron: "0 0 * * *" | ||
|
||
repository_dispatch: | ||
types: [update-vespa-version] | ||
|
||
# For testing purposes | ||
push: | ||
branches: [auto-update-versions] | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
update-vespa-version: | ||
runs-on: ubuntu-24.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y xq | ||
- name: Get Latest Vespa version | ||
run: | | ||
VESPA_VERSION=$(curl -sSL https://repo1.maven.org/maven2/com/yahoo/vespa/parent/maven-metadata.xml | \ | ||
xq -x '/metadata/versioning/latest') | ||
echo "Vespa version: $VESPA_VERSION" | ||
sed -i'' "s/\(vespa_version:\) \"[0-9\.]*\"/\1 \"${VESPA_VERSION}\"/" _config.yml | ||
git diff | ||
# Check if there are changes to commit. | ||
if [[ -n "$(git status --porcelain)" ]]; then | ||
echo "Updating Vespa version in documentation to \${VESPA_VERSION}" | ||
git commit -m "Update Vespa-version to \${VESPA_VERSION} MERGEOK" _config.yml | ||
git pull --rebase | ||
# Temp disabled while testing | ||
# git push | ||
fi |
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