-
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 37ff1ce
Showing
1 changed file
with
71 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,71 @@ | ||
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 * * *" | ||
|
||
# For testing purposes | ||
push: | ||
branches: [auto-update-versions] | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
update-vespa-version: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup xq | ||
env: | ||
URL_PREFIX: "https://github.com/sibprogrammer/xq" | ||
INSTALL_DIR: /usr/local/bin/ | ||
BINARY: xq | ||
run: | | ||
LATEST_VERSION=$(curl -L -s -H 'Accept: application/json' $URL_PREFIX/releases/latest | sed -e 's/.*"tag_name":"v\([^"]*\)".*/\1/') | ||
PLATFORM=$(uname -s | tr A-Z a-z) | ||
case "$(uname -m)" in | ||
arm64) | ||
ARCH=arm64 | ||
;; | ||
aarch64) | ||
ARCH=arm64 | ||
;; | ||
armv6l) | ||
ARCH=armv6 | ||
;; | ||
armv7l) | ||
ARCH=armv7 | ||
;; | ||
*) | ||
ARCH=amd64 | ||
;; | ||
esac | ||
ARCHIVE="${BINARY}_${LATEST_VERSION}_${PLATFORM}_${ARCH}.tar.gz" | ||
URL="$URL_PREFIX/releases/download/v${LATEST_VERSION}/$ARCHIVE" | ||
echo "Installation of $BINARY" | ||
rm -f $INSTALL_DIR$BINARY | ||
curl -sSL "$URL" | tar xz -C $INSTALL_DIR $BINARY | ||
chmod +x $INSTALL_DIR$BINARY | ||
echo "Successfully installed at $INSTALL_DIR$BINARY" | ||
- name: Get Latest Vespa version | ||
run: | | ||
VESPA_VERSION=$(curl -sSL https://repo1.maven.org/maven2/com/yahoo/vespa/parent/maven-metadata.xml | \ | ||
grep -oP '<latest>\K([0-9]+\.[0-9]+\.[0-9]+)') | ||
echo "Vespa version: $VESPA_VERSION" | ||
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" |