Skip to content

Commit

Permalink
Merge pull request #4 from bakjos/bakjos/registry_dir
Browse files Browse the repository at this point in the history
feat: Add the option to specify the registry dir
  • Loading branch information
shepmaster authored Nov 4, 2024
2 parents a72b3ff + d70eb13 commit 9564df1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jobs:

## Inputs

| Input | Default | Description |
| -------- | ------- | ------------------------------------------- |
| `crates` | N/A | A glob expression for the crates to publish |
| Input | Default | Description |
| ---------- | ------- | ------------------------------------------- |
| `crates` | N/A | A glob expression for the crates to publish |
| `registry` | `'.'` | The path to the Margo registry directory |
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ inputs:
description: "The GitHub token to use"
required: true
default: "gh-pages"
registry-dir:
description: "The directory to publish the registry to"
required: false
default: "."
runs:
using: "node20"
main: "dist/main/index.js"
8 changes: 7 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ async function ensureStaticRegistryTool() {

async function run() {
let cratePathsPattern = actions.getInput("crates");
let registryDir = actions.getInput("registry-dir");
let cratePathsGlob = await glob.create(cratePathsPattern, {
matchDirectories: false,
});
Expand All @@ -64,7 +65,12 @@ async function run() {

await actions.group("Publish code to registry", async () => {
for (const cratePath of cratePaths) {
await exec.getExecOutput("margo", ["add", "--registry", ".", cratePath]);
await exec.getExecOutput("margo", [
"add",
"--registry",
registryDir,
cratePath,
]);
}
});
}
Expand Down

0 comments on commit 9564df1

Please sign in to comment.