Skip to content

Commit

Permalink
Merge branch 'main' into ui-table-layout-hints
Browse files Browse the repository at this point in the history
  • Loading branch information
mattrunyon committed Jun 28, 2024
2 parents 89becb9 + 32d09e8 commit 184eb5c
Show file tree
Hide file tree
Showing 65 changed files with 2,129 additions and 1,012 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/build-main-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build Main Docs

on:
workflow_call:
inputs:
package:
description: The plugin to publish the docs for
required: true
type: string

jobs:
check-make-docs:
runs-on: ubuntu-22.04
outputs:
files_exists: ${{ steps.check_files.outputs.files_exists }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Check file existence
id: check_files
uses: andstor/file-existence-action@v3
with:
files: "plugins/${{ inputs.package }}/make_docs.py"

build-plugin:
if: needs.check-make-docs.outputs.files_exists == 'true'
needs: check-make-docs
uses: ./.github/workflows/build-python-package.yml
with:
package: ${{ inputs.package }}

main-docs:
needs: build-plugin
uses: ./.github/workflows/make-docs.yml
secrets: inherit
with:
package: ${{ inputs.package }}
version: 'main'


54 changes: 54 additions & 0 deletions .github/workflows/build-python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build Python Package

on:
workflow_call:
inputs:
package:
required: true
type: string

jobs:
build-python-package:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Check file existence
id: check_files
uses: andstor/file-existence-action@v3
with:
files: "plugins/${{ inputs.package }}/src/js/package.json"

- name: Setup Node
if: steps.check_files.outputs.files_exists == 'true'
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: Install npm dependencies
if: steps.check_files.outputs.files_exists == 'true'
run: npm ci

- name: Build npm packages
if: steps.check_files.outputs.files_exists == 'true'
run: npm run build -- --scope "@deephaven/js-plugin-${{ inputs.package }}"

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install build dependencies
run: python -m pip install --upgrade setuptools wheel build

- name: Build wheel
run: python -m build --wheel --sdist plugins/${{ inputs.package }}

- name: Upload dist
uses: actions/upload-artifact@v3
with:
name: dist-${{ inputs.package }}
path: plugins/${{ inputs.package }}/dist/
if-no-files-found: error
57 changes: 57 additions & 0 deletions .github/workflows/make-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Make Docs

on:
workflow_call:
inputs:
package:
required: true
type: string
version:
required: true
type: string

jobs:
make-docs:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3

# assume that the dist artifact is already available from calling build-python-package.yml before this workflow
- name: Download dist
uses: actions/download-artifact@v3
with:
name: dist-${{ inputs.package }}
path: plugins/${{ inputs.package }}/dist/

- name: Install requirements
run: pip install -r plugins/${{ inputs.package }}/requirements.txt

- name: Install wheel
run: pip install plugins/${{ inputs.package }}/dist/*.whl

- name: Run make_docs.py
run: python plugins/${{ inputs.package }}/make_docs.py

- name: Setup rclone
run: |
sudo apt-get update
sudo apt-get install -y rclone
mkdir -p $HOME/.config
mkdir -p $HOME/.config/rclone
cat << EOF > $HOME/.config/rclone/rclone.conf
[plugindocs]
type = s3
provider = Cloudflare
access_key_id = ${{ secrets.DOCS_CLOUDFLARE_ACCESS_KEY_ID }}
secret_access_key = ${{ secrets.DOCS_CLOUDFLARE_SECRET_ACCESS_KEY }}
endpoint = ${{ secrets.DOCS_CLOUDFLARE_ENDPOINT }}
no_check_bucket = true
acl = private
EOF
- name: Sync docs
run: rclone sync plugins/${{ inputs.package }}/docs/build/markdown/ plugindocs:website/deephaven/deephaven-plugins/${{ inputs.package }}/${{ inputs.version }}/
13 changes: 13 additions & 0 deletions .github/workflows/modified-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,18 @@ jobs:
needs: filter-release
if: ${{ needs.filter-release.outputs.package != '' }}
uses: ./.github/workflows/release-python-package.yml
secrets: inherit
with:
package: ${{ needs.filter-release.outputs.package }}

# Main docs are built here, whereas release docs are built in release-python-package.yml
build-main-docs:
needs: changes
if: ${{ needs.changes.outputs.packages != '[]' && needs.changes.outputs.packages != '' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
strategy:
matrix:
package: ${{ fromJSON(needs.changes.outputs.packages) }}
uses: ./.github/workflows/build-main-docs.yml
secrets: inherit
with:
package: ${{ matrix.package }}
7 changes: 4 additions & 3 deletions .github/workflows/publish-alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ jobs:
with:
fetch-depth: '0' # Need the history to properly select the canary version number
ref: ${{ github.event.inputs.ref }}
- uses: actions/setup-node@v3
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build packages
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
with:
ref: ${{ github.ref }}
- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build production
Expand Down
85 changes: 51 additions & 34 deletions .github/workflows/release-python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,54 +13,71 @@ jobs:
with:
package: ${{ inputs.package }}

build-dist:
build-plugin:
needs: test
uses: ./.github/workflows/build-python-package.yml
with:
package: ${{ inputs.package }}

release:
needs: build-plugin
runs-on: ubuntu-22.04
permissions:
id-token: write
outputs:
version: ${{ steps.extract_version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'

- name: Check file existence
id: check_files
uses: andstor/file-existence-action@v3
with:
files: "plugins/${{ inputs.package }}/src/js/package.json"

- name: Install npm dependencies
if: steps.check_files.outputs.files_exists == 'true'
run: npm ci

- name: Build npm packages
if: steps.check_files.outputs.files_exists == 'true'
run: npm run build -- --scope "@deephaven/js-plugin-${{ inputs.package }}"

- name: Set up Python
uses: actions/setup-python@v4
- name: Download dist
uses: actions/download-artifact@v3
with:
python-version: '3.x'
name: dist-${{ inputs.package }}
path: plugins/${{ inputs.package }}/dist/

- name: Install build dependencies
run: python -m pip install --upgrade setuptools wheel build
- name: Get the name of the whl file
id: get_whl
run: |
WHL_DIR=plugins/${{ inputs.package }}/dist/
WHL_FILE=$(ls $WHL_DIR | grep .whl)
echo "whl_path=${WHL_DIR}${WHL_FILE}" >> $GITHUB_OUTPUT
- name: Build wheel
run: python -m build --wheel --sdist plugins/${{ inputs.package }}
- name: Install pkginfo
run: pip install pkginfo

- name: Upload dist
uses: actions/upload-artifact@v3
with:
name: dist
path: plugins/${{ inputs.package }}/dist/
if-no-files-found: error
- name: Extract package version
id: extract_version
run: |
VERSION=$(python -c 'import pkginfo; print(pkginfo.Wheel("${{ steps.get_whl.outputs.whl_path }}").version)')
echo "version=${VERSION}" >> $GITHUB_OUTPUT
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: plugins/${{ inputs.package }}/dist/

check-make-docs:
runs-on: ubuntu-22.04
outputs:
files_exists: ${{ steps.check_files.outputs.files_exists }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Check file existence
id: check_files
uses: andstor/file-existence-action@v3
with:
files: "plugins/${{ inputs.package }}/make_docs.py"

release-docs:
if: needs.check-make-docs.outputs.files_exists == 'true'
needs:
- release
- check-make-docs
uses: ./.github/workflows/make-docs.yml
secrets: inherit
with:
package: ${{ inputs.package }}
version: ${{ needs.release.outputs.version }}
Loading

0 comments on commit 184eb5c

Please sign in to comment.