mirror of
https://github.com/ivabus/pantry
synced 2024-11-26 18:25:08 +03:00
simplify index-packages (#153)
* simplify index-packages * Fix import map location * sqs modules needs permission :x --------- Co-authored-by: Max Howell <mxcl@me.com>
This commit is contained in:
parent
abb0921f3d
commit
72b9fa85bd
4 changed files with 12 additions and 25 deletions
18
.github/workflows/index-data.yml
vendored
18
.github/workflows/index-data.yml
vendored
|
@ -12,23 +12,9 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
|
||||||
path: tea.xyz/var/cli
|
|
||||||
repository: teaxyz/cli
|
|
||||||
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
path: pantry
|
|
||||||
|
|
||||||
- uses: teaxyz/setup@v0
|
- uses: teaxyz/setup@v0
|
||||||
with:
|
- run: ./scripts/index-packages.ts ${{ inputs.projects }}
|
||||||
srcroot: tea.xyz/var/pantry
|
|
||||||
prefix: ${{ github.workspace }}
|
|
||||||
|
|
||||||
- run: ./pantry/scripts/index-packages.ts ${{ inputs.projects }}
|
|
||||||
env:
|
env:
|
||||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
TEA_PANTRY_PATH: ${{ github.workspace }}
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
||||||
AWS_REGION: us-east-1
|
AWS_REGION: us-east-1
|
||||||
SQS_GENERATE_PACKAGE_DETAILS_URL: ${{ secrets.SQS_GENERATE_PACKAGE_DETAILS_URL }}
|
SQS_GENERATE_PACKAGE_DETAILS_URL: ${{ secrets.SQS_GENERATE_PACKAGE_DETAILS_URL }}
|
||||||
TEA_PANTRY_PATH: ${{ github.workspace }}
|
|
||||||
|
|
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
|
@ -2,5 +2,6 @@
|
||||||
"deno.enable": true,
|
"deno.enable": true,
|
||||||
"deno.lint": true,
|
"deno.lint": true,
|
||||||
"deno.unstable": true,
|
"deno.unstable": true,
|
||||||
"deno.config": "deno.jsonc"
|
"deno.config": "deno.jsonc",
|
||||||
|
"deno.importMap": "../cli/import-map.json"
|
||||||
}
|
}
|
|
@ -19,6 +19,5 @@
|
||||||
"deno.land": "^1.30"
|
"deno.land": "^1.30"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"importMap": "https://raw.githubusercontent.com/teaxyz/cli/v0.21/import-map.json"
|
"importMap": "https://raw.githubusercontent.com/teaxyz/cli/v0.22.1/import-map.json"
|
||||||
// ^^ stuck in the past because we moved the import map into deno.json :-/
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,21 +8,22 @@ args:
|
||||||
- --allow-env
|
- --allow-env
|
||||||
- --allow-net
|
- --allow-net
|
||||||
- --allow-sys
|
- --allow-sys
|
||||||
- --import-map={{ srcroot }}/import-map.json
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
import * as semver from "semver"
|
|
||||||
import { usePantry } from "hooks"
|
import { usePantry } from "hooks"
|
||||||
import * as ARGV from "./utils/args.ts"
|
import * as ARGV from "./utils/args.ts"
|
||||||
import { SQSClient, SendMessageCommand } from "npm:@aws-sdk/client-sqs"
|
import { SQSClient, SendMessageCommand } from "npm:@aws-sdk/client-sqs@^3"
|
||||||
|
import { panic } from "utils"
|
||||||
|
|
||||||
const sqsClient = new SQSClient({ region: 'us-east-1' })
|
const sqsClient = new SQSClient({ region: Deno.env.get("AWS_REGION") ?? panic("No region specified") })
|
||||||
const pantry = usePantry()
|
const pantry = usePantry()
|
||||||
|
|
||||||
const pkgs = await ARGV.toArray(ARGV.pkgs())
|
const pkgs = await ARGV.toArray(ARGV.pkgs())
|
||||||
for(const { project } of pkgs) {
|
for(const pkg of pkgs) {
|
||||||
try {
|
try {
|
||||||
const yml = await pantry.getYAML({ project, constraint: new semver.Range('*') }).parse()
|
const yml = await pantry.getYAML(pkg).parse()
|
||||||
|
|
||||||
|
const project = pkg.project
|
||||||
|
|
||||||
const taskMessage = {
|
const taskMessage = {
|
||||||
project,
|
project,
|
||||||
|
|
Loading…
Reference in a new issue