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:
Jacob Heider 2023-02-02 16:51:19 -05:00 committed by GitHub
parent abb0921f3d
commit 72b9fa85bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 25 deletions

View file

@ -12,23 +12,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
path: tea.xyz/var/cli
repository: teaxyz/cli
- uses: actions/checkout@v3
with:
path: pantry
- uses: teaxyz/setup@v0
with:
srcroot: tea.xyz/var/pantry
prefix: ${{ github.workspace }}
- run: ./pantry/scripts/index-packages.ts ${{ inputs.projects }}
- run: ./scripts/index-packages.ts ${{ inputs.projects }}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
TEA_PANTRY_PATH: ${{ github.workspace }}
AWS_REGION: us-east-1
SQS_GENERATE_PACKAGE_DETAILS_URL: ${{ secrets.SQS_GENERATE_PACKAGE_DETAILS_URL }}
TEA_PANTRY_PATH: ${{ github.workspace }}

View file

@ -2,5 +2,6 @@
"deno.enable": true,
"deno.lint": true,
"deno.unstable": true,
"deno.config": "deno.jsonc"
"deno.config": "deno.jsonc",
"deno.importMap": "../cli/import-map.json"
}

View file

@ -19,6 +19,5 @@
"deno.land": "^1.30"
}
},
"importMap": "https://raw.githubusercontent.com/teaxyz/cli/v0.21/import-map.json"
// ^^ stuck in the past because we moved the import map into deno.json :-/
"importMap": "https://raw.githubusercontent.com/teaxyz/cli/v0.22.1/import-map.json"
}

View file

@ -8,21 +8,22 @@ args:
- --allow-env
- --allow-net
- --allow-sys
- --import-map={{ srcroot }}/import-map.json
---*/
import * as semver from "semver"
import { usePantry } from "hooks"
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 pkgs = await ARGV.toArray(ARGV.pkgs())
for(const { project } of pkgs) {
for(const pkg of pkgs) {
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 = {
project,