-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #789 from vespa-engine/thomasht86/ci-updates
CI - VespaCLI: Fix autodist
- Loading branch information
Showing
6 changed files
with
179 additions
and
236 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,179 @@ | ||
name: vespacli - Check, Update, Test, Create PR, Release | ||
|
||
defaults: | ||
run: | ||
working-directory: ./vespacli | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
# Run at midnight sunday-thursday | ||
- cron: "0 0 * * 1-4" | ||
|
||
jobs: | ||
check-and-update: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version: ${{ steps.set_output.outputs.version }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install dependencies and this repo | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -e .[build] | ||
- name: Check latest version and set version variable | ||
id: check_latest_version | ||
run: | | ||
version=$(python utils/check_latest_version.py) | ||
echo "Latest version is $version" | ||
# Set the output variable | ||
echo "version=$version" >> $GITHUB_OUTPUT | ||
- name: Update the version (if not NA) | ||
if: ${{ (steps.check_latest_version.outputs.version != 'NA') }} | ||
run: | | ||
# Print evaluation of the condition | ||
echo "Version is not NA, updating version to ${{ steps.check_latest_version.outputs.version }}" | ||
echo "Updating Vespa CLI version to ${{ steps.check_latest_version.outputs.version }}" | ||
python utils/update_version.py --version ${{ steps.check_latest_version.outputs.version }} | ||
- name: Download latest binaries | ||
if: ${{ steps.check_latest_version.outputs.version != 'NA' }} | ||
run: | | ||
python utils/download_binaries.py --version ${{ steps.check_latest_version.outputs.version }} | ||
- name: Upload binaries as artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: binaries | ||
path: vespacli/vespacli/go-binaries | ||
|
||
- name: Set the output variable | ||
id: set_output | ||
if: ${{ steps.check_latest_version.outputs.version != 'NA' }} | ||
run: | | ||
echo "version=${{ steps.check_latest_version.outputs.version }}" >> $GITHUB_OUTPUT | ||
test: | ||
needs: check-and-update | ||
if: ${{ needs.check-and-update.outputs.version != 'NA' }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-12, macos-14] | ||
python-version: ["3.10", "3.11"] # Update or modify Python versions as needed | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Download artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: binaries | ||
path: vespacli/vespacli/go-binaries | ||
|
||
- name: Set permissions on all files in go-binaries | ||
run: | | ||
chmod -R +x vespacli/go-binaries/* | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -e .[build] | ||
- name: Update latest version | ||
run: | | ||
python utils/update_version.py --version ${{ needs.check-and-update.outputs.version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -e .[build] | ||
- name: Verify installation | ||
run: | | ||
vespa version | ||
create-pr: | ||
needs: [check-and-update, test] | ||
outputs: | ||
version: ${{ needs.check-and-update.outputs.version }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install dependencies and this repo | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -e .[build] | ||
- name: Update latest version | ||
run: | | ||
python utils/update_version.py --version ${{ needs.check-and-update.outputs.version }} | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v6 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
commit-message: "Update Vespa CLI version to ${{ needs.check-and-update.outputs.version }}" | ||
title: "Update Vespa CLI version to ${{ needs.check-and-update.outputs.version }}" | ||
body: "This PR updates the Vespa CLI version to ${{ needs.check-and-update.outputs.version }}" | ||
branch: "update-vespa-cli-version-${{ needs.check-and-update.outputs.version }}" | ||
base: "master" | ||
labels: "vespacli" | ||
|
||
release: | ||
needs: create-pr | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install dependencies and this repo | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -e .[build] | ||
- name: Download artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: binaries | ||
path: vespacli/vespacli/go-binaries | ||
|
||
- name: Set permissions on all files in go-binaries | ||
run: | | ||
chmod -R +x vespacli/go-binaries/* | ||
- name: Update latest version | ||
run: | | ||
python utils/update_version.py --version ${{ needs.create-pr.outputs.version }} | ||
- name: Build | ||
run: | | ||
python -m build | ||
- name: Upload to PyPI | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN_VESPACLI }} | ||
run: | | ||
python -m twine upload dist/* |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.