Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -353,16 +353,15 @@ jobs:
- name: Setup Node.JS
uses: ./.github/actions/nodejs

# `npm publish` in release-npm returns before the registry makes the new
# versions resolvable; pack_dashmate.sh installs them from the registry.
- name: Wait for published NPM packages to become resolvable
run: "${GITHUB_WORKSPACE}/scripts/wait_for_npm_packages.sh"

- name: Create package
env:
# Packaging executes dependency and lifecycle scripts, including
# output from the persistent builder. Signing happens in a new job.
DASHMATE_UNSIGNED: 'true'
# Install the workspace packages from the tarballs release-npm
# published, not from the registry: npm can take many minutes to
# serve a version it has just accepted.
DASHMATE_NPM_TARBALLS_DIR: ${{ github.workspace }}/npm-packages
run: |
"${GITHUB_WORKSPACE}/scripts/pack_dashmate.sh" "${{ matrix.package_type }}"

Expand Down
23 changes: 23 additions & 0 deletions scripts/pack_dashmate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,29 @@ echo "nodeLinker: node-modules" > .yarnrc.yml
if [ "$COMMAND" = macos ] && [ "${DASHMATE_UNSIGNED:-false}" = true ]; then
node -e 'const fs = require("fs"); const p = JSON.parse(fs.readFileSync("package.json", "utf8")); delete p.oclif.macos.sign; fs.writeFileSync("package.json", JSON.stringify(p, null, 2) + "\n");'
fi
# The release workflow passes the npm tarballs it publishes. Install the
# workspace packages from them rather than from the registry, which can take
# many minutes to serve a version it has just accepted. The paths must be
# absolute: `oclif pack` installs again from a copy of this lockfile in its
# own tmp directory.
if [ -n "${DASHMATE_NPM_TARBALLS_DIR:-}" ]; then
DASHMATE_NPM_TARBALLS_DIR="$(realpath "$DASHMATE_NPM_TARBALLS_DIR")" node -e '
const fs = require("fs");
const path = require("path");
const { execFileSync } = require("child_process");
const dir = process.env.DASHMATE_NPM_TARBALLS_DIR;
const p = JSON.parse(fs.readFileSync("package.json", "utf8"));
const tarballs = fs.readdirSync(dir).filter((file) => file.endsWith(".tgz"));
if (tarballs.length === 0) throw new Error(`No npm tarballs in ${dir}`);
p.resolutions = {};
for (const file of tarballs) {
const tarball = path.join(dir, file);
const { name } = JSON.parse(execFileSync("tar", ["-xOzf", tarball, "package/package.json"], { encoding: "utf8" }));
if (name !== p.name) p.resolutions[name] = `file:${tarball}`;
}
fs.writeFileSync("package.json", JSON.stringify(p, null, 2) + "\n");
'
fi
yarn install --no-immutable
yarn oclif manifest
yarn oclif pack $COMMAND $FLAGS
Expand Down
76 changes: 0 additions & 76 deletions scripts/wait_for_npm_packages.sh

This file was deleted.

Loading