Release #551
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
name: Release | |
on: | |
workflow_dispatch: | |
inputs: | |
full-release: | |
type: boolean | |
description: | | |
Full release, i.e., non-snapshot. | |
This is only respected when the workflow runs on the main branch. | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
jobs: | |
release-plugin: | |
runs-on: | |
- ubuntu-22.04 | |
timeout-minutes: 10 | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # Needed for git-based changelog. | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'adopt' | |
java-version: 19 | |
cache: 'sbt' | |
- uses: arduino/setup-task@v1 | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Assemble | |
run: task jvmAssemble | |
- name: Publish Release | |
if: ${{ github.ref == 'refs/heads/main' && github.event.inputs.full-release == 'true' }} | |
run: task jvmPublishRelease | |
- name: Publish Snapshot | |
if: ${{ github.event.inputs.full-release != 'true' }} | |
run: task jvmPublishSnapshot VERSION=$(cat version)-SNAPSHOT-${{ github.run_number }}${{ github.run_attempt }} | |
release-python-client: | |
needs: release-plugin | |
runs-on: | |
- ubuntu-22.04 | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10.8' | |
cache: 'pip' | |
- uses: arduino/setup-task@v1 | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup pypirc file | |
env: | |
TESTPYPI_TOKEN: ${{ secrets.TESTPYPI_TOKEN }} | |
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | |
run: envsubst < .github/workflows/pypirc.template > $HOME/.pypirc | |
- name: Setup Setuptools | |
run: python3 -m pip install setuptools | |
- name: Publish Release | |
if: ${{ github.ref == 'refs/heads/main' && github.event.inputs.full-release == 'true' }} | |
run: task pyPublishRelease | |
- name: Publish Snapshot | |
if: ${{ github.event.inputs.full-release != 'true' }} | |
run: task pyPublishSnapshot VERSION=$(cat version)-dev${{ github.run_number }}${{ github.run_attempt }} | |
release-docs: | |
needs: release-python-client | |
if: ${{ github.ref == 'refs/heads/main' && github.event.inputs.full-release == 'true' }} | |
runs-on: | |
- ubuntu-22.04 | |
timeout-minutes: 10 | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10.8' | |
cache: 'pip' | |
- uses: arduino/setup-task@v1 | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Generate Jekyll Site | |
run: | | |
sudo chown -R runneradmin:runneradmin docs | |
task docsCompile | |
sudo chown -R runner:docker docs | |
- name: Generate Python Docs | |
run: | | |
task pyDocs | |
mkdir -p docs/_site/docs | |
mv client-python/pdoc/elastiknn docs/_site/docs/pdoc | |
- name: Configure Pages | |
uses: actions/configure-pages@v2 | |
- name: Upload Pages Artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: 'docs/_site' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 |