diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8279898e8d..382cce81d9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1595,18 +1595,154 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Install yarn - run: npm install -g yarn + - uses: actions/download-artifact@v3 + if: success() || failure() + with: + name: perspective-cli-dist + path: packages/perspective-cli/dist - - name: Install js dependencies - run: yarn --frozen-lockfile - env: - PSP_SKIP_EMSDK_INSTALL: 1 + - uses: actions/download-artifact@v3 + if: success() || failure() + with: + name: perspective-dist + path: packages/perspective/dist/ + + - uses: actions/download-artifact@v3 + if: success() || failure() + with: + name: perspective-jupyterlab-dist + path: packages/perspective-jupyterlab/dist/ + + - uses: actions/download-artifact@v3 + if: success() || failure() + with: + name: perspective-viewer-d3fc-dist + path: packages/perspective-viewer-d3fc/dist + + - uses: actions/download-artifact@v3 + if: success() || failure() + with: + name: perspective-viewer-datagrid-dist + path: packages/perspective-viewer-datagrid/dist + + - uses: actions/download-artifact@v3 + if: success() || failure() + with: + name: perspective-viewer-openlayers-dist + path: packages/perspective-viewer-openlayers/dist + + - uses: actions/download-artifact@v3 + if: success() || failure() + with: + name: perspective-workspace-dist + path: packages/perspective-workspace/dist + + - uses: actions/download-artifact@v3 + if: success() || failure() + with: + name: perspective-viewer-dist + path: rust/perspective-viewer/dist + + - uses: actions/download-artifact@v3 + if: success() || failure() + with: + name: perspective-esbuild-plugin-dist + path: packages/perspective-esbuild-plugin/dist - - name: Run publish script - run: node tools/perspective-scripts/publish.mjs + - uses: actions/download-artifact@v3 + if: success() || failure() + with: + name: perspective-webpack-plugin-dist + path: packages/perspective-webpack-plugin/dist + + - uses: actions/download-artifact@v3 + with: + name: nbextension-dist + path: python/perspective/perspective/nbextension + + - uses: actions/download-artifact@v3 + with: + name: labextension-dist + path: python/perspective/perspective/labextension + + - uses: actions/download-artifact@v3 + with: + name: perspective-python-dist-ubuntu-20.04-3.7 + + - uses: actions/download-artifact@v3 + with: + name: perspective-python-dist-ubuntu-20.04-3.8 + + - uses: actions/download-artifact@v3 + with: + name: perspective-python-dist-ubuntu-20.04-3.9 + + - uses: actions/download-artifact@v3 + with: + name: perspective-python-dist-ubuntu-20.04-3.10 + + - uses: actions/download-artifact@v3 + with: + name: perspective-python-dist-ubuntu-20.04-3.11 + + - uses: actions/download-artifact@v3 + with: + name: perspective-python-dist-macos-11-3.7 + + - uses: actions/download-artifact@v3 + with: + name: perspective-python-dist-macos-11-3.8 + + - uses: actions/download-artifact@v3 + with: + name: perspective-python-dist-macos-11-3.9 + + - uses: actions/download-artifact@v3 + with: + name: perspective-python-dist-macos-11-3.10 + + - uses: actions/download-artifact@v3 + with: + name: perspective-python-dist-macos-11-3.11 + + - uses: actions/download-artifact@v3 + with: + name: perspective-python-dist-window-2019-3.7 + + - uses: actions/download-artifact@v3 + with: + name: perspective-python-dist-window-2019-3.8 + + - uses: actions/download-artifact@v3 + with: + name: perspective-python-dist-window-2019-3.9 + + - uses: actions/download-artifact@v3 + with: + name: perspective-python-dist-window-2019-3.10 + + - uses: actions/download-artifact@v3 + with: + name: perspective-python-dist-window-2019-3.11 + + - uses: actions/download-artifact@v3 + with: + name: perspective-python-dist-pyodide + + - uses: actions/download-artifact@v3 + with: + name: perspective-python-sdist + # path: python/perspective/dist/*.tar.gz + + - name: Debug + run: ls -lah + + - name: Release wheels + uses: softprops/action-gh-release@v1 + with: + draft: true + generate_release_notes: true + files: | + *.whl env: - CI: true GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_WORKFLOW_ID: ${{ github.run_id }} - COMMIT: ${{ github.sha }} diff --git a/tools/perspective-scripts/publish.mjs b/tools/perspective-scripts/publish.mjs index ae581c9056..01183adb0a 100644 --- a/tools/perspective-scripts/publish.mjs +++ b/tools/perspective-scripts/publish.mjs @@ -16,10 +16,9 @@ import decompressUnzip from "decompress-unzip"; import { promises as fs } from "fs"; import { Octokit } from "octokit"; import readline from "readline"; +import sh from "./sh.mjs"; -const CURRENT_TAG = execSync("git describe --exact-match --tags") - .toString() - .trim(); +const CURRENT_TAG = sh`git describe --exact-match --tags`.execSync(); // Artifacts Docs: // https://docs.github.com/en/rest/actions/artifacts @@ -216,22 +215,25 @@ if (proceed.toLowerCase() === "y") { recursive: true, }); - const release = await octokit.request( - "POST /repos/{owner}/{repo}/releases", - { - owner: "finos", - repo: "perspective", - tag_name: CURRENT_TAG, - name: CURRENT_TAG, - body: "Release of perspective", - draft: false, - prerelease: false, - generate_release_notes: false, - headers: { - "X-GitHub-Api-Version": "2022-11-28", - }, - } - ); + if (process.env.CI) { + console.log(`Creating GitHub Release ${CURRENT_TAG}`); + const release = await octokit.request( + "POST /repos/{owner}/{repo}/releases", + { + owner: "finos", + repo: "perspective", + tag_name: CURRENT_TAG, + name: CURRENT_TAG, + // body: "Release of perspective", + draft: true, + prerelease: false, + generate_release_notes: true, + headers: { + "X-GitHub-Api-Version": "2022-11-28", + }, + } + ); + } // Download the artifact folders await Promise.all( @@ -247,17 +249,19 @@ if (proceed.toLowerCase() === "y") { } ); - await octokit.request({ - method: "POST", - url: release.data.upload_url, - owner: "finos", - repo: "perspective", - data: download.data, - name: `${artifact.name}.zip`, - headers: { - "X-GitHub-Api-Version": "2022-11-28", - }, - }); + if (process.env.CI) { + await octokit.request({ + method: "POST", + url: release.data.upload_url, + owner: "finos", + repo: "perspective", + data: download.data, + name: `${artifact.name}.zip`, + headers: { + "X-GitHub-Api-Version": "2022-11-28", + }, + }); + } if (!artifact.name.includes("pyodide")) { // Write out the zip file @@ -272,27 +276,31 @@ if (proceed.toLowerCase() === "y") { // Unzip the folders await Promise.all( python_dist_folders.map(async (artifact) => { - await decompress( - `${dist_folder}/${artifact.name}.zip`, - `${dist_folder}/${artifact.name}`, - { - plugins: [decompressUnzip()], - } - ); + if (!artifact.name.includes("pyodide")) { + await decompress( + `${dist_folder}/${artifact.name}.zip`, + `${dist_folder}/${artifact.name}`, + { + plugins: [decompressUnzip()], + } + ); + } }) ); // Move the wheels await Promise.all( python_dist_folders.map(async (artifact) => { - await cp( - [`${dist_folder}/${artifact.name}/*.whl`], - `${wheel_folder}` - ); - await cp( - [`${dist_folder}/${artifact.name}/*.tar.gz`], - `${wheel_folder}` - ); + if (!artifact.name.includes("pyodide")) { + await cp( + [`${dist_folder}/${artifact.name}/*.whl`], + `${wheel_folder}` + ); + await cp( + [`${dist_folder}/${artifact.name}/*.tar.gz`], + `${wheel_folder}` + ); + } }) ); @@ -326,17 +334,19 @@ if (proceed.toLowerCase() === "y") { } ); - await octokit.request({ - method: "POST", - url: release.data.upload_url, - owner: "finos", - repo: "perspective", - data: download.data, - name: `${artifact.name}.zip`, - headers: { - "X-GitHub-Api-Version": "2022-11-28", - }, - }); + if (process.env.CI) { + await octokit.request({ + method: "POST", + url: release.data.upload_url, + owner: "finos", + repo: "perspective", + data: download.data, + name: `${artifact.name}.zip`, + headers: { + "X-GitHub-Api-Version": "2022-11-28", + }, + }); + } // Write out the zip file await fs.appendFile(