don’t need cli checkouts anymore (#146)

* don’t need cli checkouts anymore
* tidy

Co-authored-by: Jacob Heider <jacob@tea.xyz>
This commit is contained in:
Max Howell 2023-02-02 09:00:52 -05:00 committed by GitHub
parent 0ee361a5d7
commit abb0921f3d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 68 additions and 170 deletions

View file

@ -7,30 +7,19 @@ on:
required: true required: true
type: string type: string
env:
TEA_PANTRY_PATH: ${{ github.workspace }}/pantry
jobs: jobs:
check-core-sizes: check-core-sizes:
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs: outputs:
gha-linux-build-size: ${{ env.GHA_LINUX_BUILD_SIZE }} gha-linux-build-size: ${{ env.GHA_LINUX_BUILD_SIZE }}
steps: steps:
- name: co pantry - uses: actions/checkout@v3
uses: actions/checkout@v3
with: with:
path: pantry
repository: teaxyz/pantry.core repository: teaxyz/pantry.core
- uses: teaxyz/setup@v0 - uses: teaxyz/setup@v0
with: - run: scripts/check-core-sizes.ts ${{ inputs.projects }}
# necessary because we currently require a `.git` directory
srcroot: pantry
- run: ./scripts/check-core-sizes.ts ${{ inputs.projects }}
working-directory: pantry
env: env:
TEA_PANTRY_PATH: ${{ env.TEA_PANTRY_PATH }} TEA_PANTRY_PATH: ${{ github.workspace }}
build: build:
runs-on: ${{ matrix.platform.os }} runs-on: ${{ matrix.platform.os }}
@ -50,57 +39,38 @@ jobs:
name: linux+aarch64 name: linux+aarch64
container: ${{ matrix.platform.container }} container: ${{ matrix.platform.container }}
steps: steps:
- name: co pantry - uses: actions/checkout@v3
uses: actions/checkout@v3
with:
path: pantry
- name: co cli
uses: actions/checkout@v3
with:
path: cli
repository: teaxyz/cli
- uses: teaxyz/setup@v0 - uses: teaxyz/setup@v0
id: tea id: tea
with: with:
# necessary because we currently require a `.git` directory
srcroot: /opt/tea.xyz/var/pantry
prefix: /opt prefix: /opt
- name: HACKS - name: sanitize macOS runners
if: matrix.platform.os == 'macos-11'
run: sudo mv /usr/local/bin/* /tmp/
- name: configure tea env
run: | run: |
case ${{ matrix.platform.os }} in echo "$PWD/scripts:$TEA_PREFIX/tea.xyz/var/pantry/scripts" >> $GITHUB_PATH
macos-11) echo "TEA_PANTRY_PATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
#FIXME we need a clean install of macOS for builds
#TODO stop using GHA images or chroot or something
for x in /usr/local/*; do sudo mv $x /tmp; done
;;
esac
ln -s $GITHUB_WORKSPACE/cli /opt/tea.xyz/var/cli - run: sort.ts ${{ inputs.projects }}
# in case this PR contains updates to the scripts
#TODO only do for PRs
if test "$GITHUB_REPOSITORY" = "teaxyz/pantry.core"; then
cp -rv pantry/scripts/* /opt/tea.xyz/var/pantry/scripts
fi
- run: /opt/tea.xyz/var/pantry/scripts/sort.ts ${{ inputs.projects }}
id: sorted id: sorted
# running out of /opt because only pantry.core has these scripts - run: build.ts ${{ steps.sorted.outputs.pkgs }}
- run: /opt/tea.xyz/var/pantry/scripts/build.ts ${{ steps.sorted.outputs.pkgs }}
id: build id: build
env: env:
GITHUB_TOKEN: ${{ github.token }} GITHUB_TOKEN: ${{ github.token }}
FORCE_UNSAFE_CONFIGURE: 1 # some configure scripts refuse to run as root FORCE_UNSAFE_CONFIGURE: 1 # some configure scripts refuse to run as root
- name: delete `.la` files - name: delete `.la` files
run: find ${{ steps.tea.outputs.prefix }} -name '*.la' -delete run: find . -name '*.la' -delete
working-directory: ${{ steps.tea.outputs.prefix }}
# cache data we'll need in the bottling job # cache data we'll need in the bottling job
- run: | - name: assemble artifact metadata
run: |
echo ${{ steps.build.outputs.pkgs }} >built echo ${{ steps.build.outputs.pkgs }} >built
echo ${{ steps.build.outputs.relative-paths }} >relative-paths echo ${{ steps.build.outputs.relative-paths }} >relative-paths
echo ${{ steps.build.outputs.srcs }} >srcs echo ${{ steps.build.outputs.srcs }} >srcs
@ -108,7 +78,8 @@ jobs:
# tarring ourselves ∵ GHA-artifacts (ludicrously) lose permissions # tarring ourselves ∵ GHA-artifacts (ludicrously) lose permissions
# /ref https://github.com/actions/upload-artifact/issues/38 # /ref https://github.com/actions/upload-artifact/issues/38
- run: - name: create artifacts.tgz
run:
tar czf $GITHUB_WORKSPACE/artifacts.tgz tar czf $GITHUB_WORKSPACE/artifacts.tgz
${{ steps.build.outputs.relative-paths }} ${{ steps.build.outputs.relative-paths }}
${{ steps.build.outputs.srcs-relative-paths }} ${{ steps.build.outputs.srcs-relative-paths }}
@ -147,36 +118,24 @@ jobs:
container: ${{ matrix.platform.container }} container: ${{ matrix.platform.container }}
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
id: tea
with:
srcroot: tea.xyz/var/pantry
prefix: ${{ github.workspace }}
- run: | - name: configure scripts PATH
# in case this PR contains updates to the scripts TODO only PRs run: echo "$PWD/scripts:$TEA_PREFIX/tea.xyz/var/pantry/scripts" >> $GITHUB_PATH
if test "$GITHUB_REPOSITORY" = "teaxyz/pantry.core"; then
cp -rv pantry/scripts/* $(tea --prefix)/tea.xyz/var/pantry/scripts
fi
if: ${{ matrix.platform.container != '' }}
- uses: actions/download-artifact@v3 - uses: actions/download-artifact@v3
with: with:
name: ${{ matrix.platform.name }} name: ${{ matrix.platform.name }}
- run: tar xzf artifacts.tgz - name: extract bottles
run: tar xzf artifacts.tgz -C $TEA_PREFIX
- run: tea.xyz/var/pantry/scripts/test.ts ${{ inputs.projects }} - run: test.ts ${{ inputs.projects }}
env:
TEA_PANTRY_PATH: ${{ github.workspace }}
- run: - name: post
run:
echo "HAS_SECRETS=$HAS_SECRETS" >>$GITHUB_ENV echo "HAS_SECRETS=$HAS_SECRETS" >>$GITHUB_ENV
env: env:
HAS_SECRETS: ${{ secrets.AWS_S3_CACHE != null }} HAS_SECRETS: ${{ secrets.AWS_S3_CACHE != null }}
@ -199,34 +158,16 @@ jobs:
name: linux+aarch64 name: linux+aarch64
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
id: tea
with:
srcroot: tea.xyz/var/pantry
prefix: ${{ github.workspace }}
- run: | - name: configure scripts PATH
tea --sync run: echo "$PWD/scripts:$TEA_PREFIX/tea.xyz/var/pantry/scripts" >> $GITHUB_PATH
# in case this PR contains updates to the scripts
#TODO only do for PRs
if test "$GITHUB_REPOSITORY" = "teaxyz/pantry.core"; then
cp -rv $GITHUB_WORKSPACE/pantry/scripts/* $(tea --prefix)/tea.xyz/var/pantry/scripts
fi
- uses: actions/download-artifact@v3 - uses: actions/download-artifact@v3
with: with:
name: ${{ matrix.platform.name }} name: ${{ matrix.platform.name }}
- run: - run: cache-artifacts.ts
tea.xyz/var/pantry/scripts/cache-artifacts.ts
${{github.repository}} ${{github.repository}}
${{github.ref}} ${{github.ref}}
${{matrix.platform.name}} ${{matrix.platform.name}}

View file

@ -3,8 +3,7 @@ name: ci-scripts
on: on:
pull_request: pull_request:
paths: paths:
- scripts/**.ts - scripts/**/*.ts
- import-map.json
jobs: jobs:
typecheck: typecheck:
@ -14,4 +13,4 @@ jobs:
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: teaxyz/setup@v0 - uses: teaxyz/setup@v0
- run: tea deno check --unstable --import-map=import-map.json scripts/*.ts - run: deno check --unstable scripts/*.ts

View file

@ -7,11 +7,8 @@ on:
required: true required: true
type: string type: string
env:
TEA_PANTRY_PATH: ${{ github.workspace }}/pantry
jobs: jobs:
queue_detail_ingestion: queue-detail-ingestion:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
@ -33,5 +30,5 @@ jobs:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1 AWS_REGION: us-east-1
TEA_PANTRY_PATH: ${{ env.TEA_PANTRY_PATH }}
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 }}

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
# for pre 1!
/deno.lock

View file

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

View file

@ -17,17 +17,5 @@ versioned.
See the contributing guide in [pantry.zero]. See the contributing guide in [pantry.zero].
&nbsp;
# Meta
## Dependencies
| Project | Version |
|-------------|---------|
| deno.land | ^1.27 |
| tea.xyz | ^0 |
[pantry.zero]: https://github.com/teaxyz/pantry.zero#contributing [pantry.zero]: https://github.com/teaxyz/pantry.zero#contributing
[pantry.extra]: https://github.com/teaxyz/pantry.extra [pantry.extra]: https://github.com/teaxyz/pantry.extra

24
deno.jsonc Normal file
View file

@ -0,0 +1,24 @@
{
"compilerOptions": {
"allowJs": false,
"strict": true
},
"tasks": {
"typecheck": "deno check --unstable scripts/*.ts"
// ^^ doesn't work yet due to lack of glob support
},
"fmt": {
"files": {
"exclude": [
"./"
]
}
},
"tea": {
"dependencies": {
"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 :-/
}

View file

@ -1,20 +0,0 @@
{
"imports": {
"prefab": "https://raw.githubusercontent.com/teaxyz/cli/v0.21.0/src/prefab/index.ts",
"semver": "https://raw.githubusercontent.com/teaxyz/cli/v0.21.0/src/utils/semver.ts",
"hooks": "https://raw.githubusercontent.com/teaxyz/cli/v0.21.0/src/hooks/index.ts",
"utils": "https://raw.githubusercontent.com/teaxyz/cli/v0.21.0/src/utils/index.ts",
"path": "https://raw.githubusercontent.com/teaxyz/cli/v0.21.0/src/vendor/Path.ts",
"prefab/": "https://raw.githubusercontent.com/teaxyz/cli/v0.21.0/src/prefab/",
"types": "https://raw.githubusercontent.com/teaxyz/cli/v0.21.0/src/types.ts",
"hooks/": "https://raw.githubusercontent.com/teaxyz/cli/v0.21.0/src/hooks/",
"utils/": "https://raw.githubusercontent.com/teaxyz/cli/v0.21.0/src/utils/",
"deno/": "https://deno.land/std@0.173.0/",
"is_what": "https://deno.land/x/is_what@v4.1.7/src/index.ts",
"cliffy/": "https://deno.land/x/cliffy@v0.25.2/",
"s3": "https://deno.land/x/s3@0.5.0/mod.ts",
"outdent": "https://deno.land/x/outdent@v0.8.0/mod.ts",
"sha256": "https://deno.land/std@0.160.0/hash/sha256.ts",
"rimbu/": "https://deno.land/x/rimbu@0.12.3/"
}
}

View file

@ -14,7 +14,6 @@ args:
- --allow-env - --allow-env
- --allow-read - --allow-read
- --allow-write - --allow-write
- --import-map={{ srcroot }}/import-map.json
--- */ --- */
import { Installation } from "types" import { Installation } from "types"

View file

@ -8,7 +8,6 @@ args:
- --allow-env - --allow-env
- --allow-read - --allow-read
- --allow-write={{tea.prefix}} - --allow-write={{tea.prefix}}
- --import-map={{ srcroot }}/import-map.json
dependencies: dependencies:
nixos.org/patchelf: '*' nixos.org/patchelf: '*'
darwinsys.com/file: 5 darwinsys.com/file: 5

View file

@ -8,7 +8,6 @@ args:
- --allow-env - --allow-env
- --allow-read - --allow-read
- --allow-write={{tea.prefix}} - --allow-write={{tea.prefix}}
- --import-map={{ srcroot }}/import-map.json
--- */ --- */
import Path from "path" import Path from "path"

View file

@ -6,7 +6,6 @@ args:
- run - run
- --allow-read - --allow-read
- --allow-env - --allow-env
- --import-map={{ srcroot }}/import-map.json
---*/ ---*/
import { Package, PackageRequirement } from "types" import { Package, PackageRequirement } from "types"

View file

@ -10,7 +10,6 @@ args:
- --allow-write={{tea.prefix}} - --allow-write={{tea.prefix}}
- --allow-env - --allow-env
- --unstable - --unstable
- --import-map={{ srcroot }}/import-map.json
---*/ ---*/
import { usePantry } from "hooks" import { usePantry } from "hooks"

View file

@ -10,7 +10,6 @@ args:
- --allow-write={{tea.prefix}} - --allow-write={{tea.prefix}}
- --allow-env - --allow-env
- --unstable - --unstable
- --import-map={{ srcroot }}/import-map.json
---*/ ---*/
import { usePantry, useFlags, useCellar, useInventory, usePrefix } from "hooks" import { usePantry, useFlags, useCellar, useInventory, usePrefix } from "hooks"

View file

@ -7,7 +7,6 @@ args:
- --allow-net - --allow-net
- --allow-read - --allow-read
- --allow-env - --allow-env
- --import-map={{ srcroot }}/import-map.json
---*/ ---*/
import { S3 } from "s3" import { S3 } from "s3"

View file

@ -7,7 +7,6 @@ args:
- --allow-read - --allow-read
- --allow-env - --allow-env
- --allow-write - --allow-write
- --import-map={{ srcroot }}/import-map.json
---*/ ---*/
import * as ARGV from "./utils/args.ts" import * as ARGV from "./utils/args.ts"

View file

@ -7,7 +7,6 @@ args:
- --allow-run - --allow-run
- --allow-read - --allow-read
- --allow-env - --allow-env
- --import-map={{ srcroot }}/import-map.json
---*/ ---*/
const args = [...Deno.args] const args = [...Deno.args]

View file

@ -7,7 +7,6 @@ args:
- --allow-net - --allow-net
- --allow-env - --allow-env
- --allow-write=./artifacts.tgz - --allow-write=./artifacts.tgz
- --import-map={{ srcroot }}/import-map.json
---*/ ---*/
/// Test /// Test

View file

@ -13,7 +13,6 @@ args:
- --allow-read - --allow-read
- --allow-write={{ tea.prefix }} - --allow-write={{ tea.prefix }}
- --allow-env - --allow-env
- --import-map={{ srcroot }}/import-map.json
---*/ ---*/
//TODO verify the sha //TODO verify the sha

View file

@ -6,7 +6,6 @@ args:
- run - run
- --allow-read - --allow-read
- --allow-env - --allow-env
- --import-map={{ srcroot }}/import-map.json
---*/ ---*/
import { useCellar, useFlags } from "hooks" import { useCellar, useFlags } from "hooks"

View file

@ -6,7 +6,6 @@ args:
- run - run
- --allow-net - --allow-net
- --allow-env=AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,AWS_S3_BUCKET - --allow-env=AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,AWS_S3_BUCKET
- --import-map={{ srcroot }}/import-map.json
---*/ ---*/
import { S3, S3Object } from "s3" import { S3, S3Object } from "s3"

View file

@ -6,7 +6,6 @@ args:
- run - run
- --allow-net - --allow-net
- --allow-env - --allow-env
- --import-map={{ srcroot }}/import-map.json
---*/ ---*/
/// Test /// Test

View file

@ -7,7 +7,6 @@ args:
- --allow-net - --allow-net
- --allow-read - --allow-read
- --allow-env=AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,AWS_S3_BUCKET - --allow-env=AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,AWS_S3_BUCKET
- --import-map={{ srcroot }}/import-map.json
---*/ ---*/
import { S3 } from "s3" import { S3 } from "s3"

View file

@ -6,7 +6,6 @@ args:
- run - run
- --allow-env - --allow-env
- --allow-net - --allow-net
- --import-map={{ srcroot }}/import-map.json
---*/ ---*/
import { S3 } from "s3" import { S3 } from "s3"

View file

@ -1,6 +1,6 @@
#!/usr/bin/env -S tea -E #!/usr/bin/env -S tea -E
// returns all pantry entries as `[{ name, path }]` /// returns all pantry entries as `[{ name, path }]`
/*--- /*---
args: args:
@ -8,7 +8,6 @@ args:
- run - run
- --allow-env - --allow-env
- --allow-read - --allow-read
- --import-map={{ srcroot }}/import-map.json
---*/ ---*/
import Path from "path" import Path from "path"

View file

@ -7,7 +7,6 @@ args:
- --allow-read - --allow-read
- --allow-env - --allow-env
- --allow-net - --allow-net
- --import-map={{ srcroot }}/import-map.json
---*/ ---*/
import { usePantry } from "hooks" import { usePantry } from "hooks"

View file

@ -6,7 +6,6 @@ args:
- run - run
- --allow-read - --allow-read
- --allow-env - --allow-env
- --import-map={{ srcroot }}/import-map.json
---*/ ---*/
// sorts input for building // sorts input for building

View file

@ -10,7 +10,6 @@ args:
- --allow-write - --allow-write
- --allow-env - --allow-env
- --unstable - --unstable
- --import-map={{ srcroot }}/import-map.json
---*/ ---*/
import { Installation, Package, PackageRequirement } from "types" import { Installation, Package, PackageRequirement } from "types"

View file

@ -7,7 +7,6 @@ args:
- --allow-read - --allow-read
- --allow-net - --allow-net
- --allow-env=AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,AWS_S3_BUCKET,TEA_PREFIX - --allow-env=AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,AWS_S3_BUCKET,TEA_PREFIX
- --import-map={{ srcroot }}/import-map.json
---*/ ---*/
import { readAll, readerFromStreamReader } from "deno/streams/mod.ts" import { readAll, readerFromStreamReader } from "deno/streams/mod.ts"

View file

@ -7,7 +7,6 @@ args:
- --allow-net - --allow-net
- --allow-read - --allow-read
- --allow-env - --allow-env
- --import-map={{ srcroot }}/import-map.json
---*/ ---*/
import { S3, S3Bucket } from "s3" import { S3, S3Bucket } from "s3"

View file

@ -1,10 +0,0 @@
{
"compilerOptions": {
"allowJs": false,
"target": "ESNext",
"moduleResolution": "node",
"esModuleInterop": true,
"module": "ESNext",
"strict": true,
}
}