refactor: slight change in dyn batch queue (#6193) #429
Workflow file for this run
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 CD | |
on: | |
push: | |
tags: | |
- "v*" # push to version tags trigger the build | |
#on: | |
# push: | |
# branches-ignore: | |
# - '**' # temporally disable this action | |
jobs: | |
update-schema: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- uses: actions/[email protected] | |
with: | |
repository: jina-ai/api | |
path: schema | |
token: ${{ secrets.JINA_DEV_BOT }} | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.7 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: '14' | |
- run: | | |
JINA_VERSION=${GITHUB_REF/refs\/tags\/v/} | |
JINA_MINOR_VERSION=${JINA_VERSION%.*} | |
V_JINA_VERSION=${GITHUB_REF/refs\/tags\//} | |
echo "JINA_VERSION=${JINA_VERSION}" >> $GITHUB_ENV | |
echo "V_JINA_VERSION=${V_JINA_VERSION}" >> $GITHUB_ENV | |
echo "JINA_MINOR_VERSION=${JINA_MINOR_VERSION}" >> $GITHUB_ENV | |
pip install . --no-cache-dir | |
cd schema | |
mkdir -p schemas | |
jina export schema --schema-path schemas/"$JINA_VERSION.json" schemas/latest.json schemas/latest --yaml-path "$JINA_VERSION.yml" latest.yml --json-path "$JINA_VERSION.json" latest.json latest | |
python ../scripts/get-openapi-schemas.py | |
npm install --prefix ~ snippet-enricher-cli | |
~/node_modules/.bin/snippet-enricher-cli --input=gateway.json --targets=shell_curl > gateway-with-code.json | |
cd - | |
- name: redoc-cli-gateway | |
uses: seeebiii/redoc-cli-github-action@v10 | |
with: | |
args: 'bundle schema/gateway-with-code.json -o rest.html' | |
- name: push-to-api-repo | |
run: | | |
mkdir -p schema/rest/ | |
cp rest.html schema/rest/index.html | |
cp rest.html schema/rest/${{env.JINA_VERSION}}.html | |
cp rest.html schema/rest/latest.html | |
cp schema/gateway.json schema/rest/${{env.JINA_VERSION}}.json | |
cp schema/gateway.json schema/rest/latest.json | |
rm schema/gateway.json schema/gateway-with-code.json | |
cd schema | |
git config --local user.email "[email protected]" | |
git config --local user.name "Jina Dev Bot" | |
git add . && git commit -m "update ${{env.JINA_VERSION}} due to ${{github.event_name}} on ${{github.repository}}" && git push | |
update-doc: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: benc-uk/workflow-dispatch@v1 | |
with: | |
workflow: Manual Docs Build | |
token: ${{ secrets.JINA_DEV_BOT }} | |
inputs: '{ "release_token": "${{ env.release_token }}", "triggered_by": "TAG", "build_old_docs": "TRUE"}' | |
env: | |
release_token: ${{ secrets.JINA_CORE_RELEASE_TOKEN }} | |
update-docker: | |
needs: update-doc | |
runs-on: ubuntu-latest | |
steps: | |
- uses: benc-uk/workflow-dispatch@v1 | |
with: | |
workflow: Manual Docker Build | |
token: ${{ secrets.JINA_DEV_BOT }} | |
inputs: '{ "release_token": "${{ env.release_token }}", "triggered_by": "TAG"}' | |
env: | |
release_token: ${{ secrets.JINA_CORE_RELEASE_TOKEN }} | |
create-release: | |
needs: update-doc | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/[email protected] | |
with: | |
ref: 'master' | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.7 | |
- run: | | |
python scripts/get-last-release-note.py | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: 💫 Patch ${{ github.ref }} | |
body_path: 'tmp.md' | |
draft: false | |
prerelease: false |