Skip to content

Commit

Permalink
pkgx
Browse files Browse the repository at this point in the history
  • Loading branch information
mxcl committed Oct 1, 2023
1 parent a98b65d commit 683319b
Show file tree
Hide file tree
Showing 91 changed files with 1,026 additions and 1,021 deletions.
7 changes: 5 additions & 2 deletions .gitbook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ redirects:
ci-cd: run/anywhere/ci-cd.md
scripts: run/anywhere/scripts.md
editors: run/anywhere/editors.md
tea-install: tea-install.md
pkgx-install: pkgx-install.md
install: pkgx-install.md
support: support.md
getting-started/install-tea/without-installer: run/anywhere/terminals.md
dev: dev.md
help/pkg-not-cached: https://github.com/orgs/pkgxdev/discussions/new?category=help&title=pkg-not-cached
help/http-failure: https://github.com/orgs/pkgxdev/discussions/new?category=help&title=http-failure
help/ambiguous-pkgspec: https://github.com/orgs/pkgxdev/discussions/new?category=help&title=ambiguous-pkgspec
9 changes: 5 additions & 4 deletions .github/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
FROM debian:buster-slim as stage0
COPY ./products/* /tea/
RUN cp /tea/$(uname -m) /usr/local/bin/tea
COPY ./products/* /pkgx/
RUN cp /pkgx/$(uname -m) /usr/local/bin/pkgx
RUN touch /root/.bash_profile
RUN tea integrate
RUN pkgx integrate

FROM debian:buster-slim as stage1
COPY --from=stage0 /usr/local/bin/tea /usr/local/bin/tea
COPY --from=stage0 /usr/local/bin/pkgx /usr/local/bin/pkgx
COPY --from=stage0 /root/.bash_profile /root/.bash_profile
RUN apt-get update && apt --yes install libc-dev libstdc++-8-dev libgcc-8-dev netbase libudev-dev
CMD ["bash"]
4 changes: 2 additions & 2 deletions .github/workflows/cd.brew.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ jobs:
- uses: aurelien-baudet/workflow-dispatch@v2
with:
workflow: bump.yml
repo: teaxyz/homebrew-pkgs
repo: pkgxdev/homebrew-made
ref: main
token: ${{secrets.TEMP_JACOBS_GITHUB_PAT}}
token: ${{secrets.GH_TOKEN}}
8 changes: 4 additions & 4 deletions .github/workflows/cd.docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ jobs:

- name: Unpack Binaries
run: |
for filename in tea-*+*+*.tar.xz; do
for filename in pkgx-*+*+*.tar.xz; do
tar xJf $filename
result="${filename#*+}"
result="${result%.tar.xz}"
mv tea $result
mv pkgx $result
rm $filename
done
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
with:
images:
ghcr.io/${{ github.repository }}
teaxyz/cli
pkgxdev/pkgx
tags: |
type=sha
type=ref,event=branch
Expand All @@ -67,7 +67,7 @@ jobs:
type=raw,value=latest
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v2
- uses: docker/setup-buildx-action@v3

- name: docker/buildx
run: |
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/cd.www.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: cd·www

# the binaries for curl tea.xyz/$(uname)/$(uname -m)
# the binaries for curl pkgx.sh/$(uname)/$(uname -m)

on:
release:
Expand Down Expand Up @@ -30,15 +30,15 @@ jobs:
go() {
tar xJf $1
mkdir -p out/$2
tar czf out/$2/$3.tgz tea
cp tea out/$2/$3
gzip tea
mv tea.gz out/$2/$3.gz
tar czf out/$2/$3.tgz pkgx
cp pkgx out/$2/$3
gzip pkgx
mv pkgx.gz out/$2/$3.gz
INVALIDATION_PATHS="$INVALIDATION_PATHS /$2/$3 /$2/$3.tgz /$2/$3.gz"
echo "INVALIDATION_PATHS=$INVALIDATION_PATHS" >> $GITHUB_ENV
}
for filename in tea-*+*+*.tar.xz; do
for filename in pkgx-*+*+*.tar.xz; do
case $filename in
*+darwin+aarch64.tar.xz)
go $filename Darwin arm64;;
Expand All @@ -54,7 +54,7 @@ jobs:
- name: Upload to S3
run:
aws s3 sync out/ s3://www.tea.xyz/
aws s3 sync out/ s3://www.pkgx.sh/
--metadata-directive REPLACE
--cache-control "max-age=3600, must-revalidate"

Expand Down
37 changes: 17 additions & 20 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
needs: [qa, integration-tests]
env:
FILENAME: tea-${{ github.event.inputs.version }}
FILENAME: pkgx-${{ github.event.inputs.version }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -33,7 +33,7 @@ jobs:
- name: stamp version.ts
run: echo "export default function() { return '${{github.event.inputs.version}}' }" > $FILENAME/src/modes/version.ts
- name: include GPG pubkey
run: echo ${{ secrets.GPG_PUBLIC_KEY }} | base64 -d > $FILENAME/tea.xyz.pub.asc
run: echo "${{ secrets.GPG_PUBLIC_KEY }}" | base64 -d > $FILENAME/pkgx.dev.pub.asc
- run: tar cJf $FILENAME.tar.xz $FILENAME
- name: attach srcs to release
run: gh release upload --clobber
Expand All @@ -43,8 +43,8 @@ jobs:
${{ env.FILENAME }}
env:
# using this token rather than github.token due to `release not found` bug
# https://github.com/cli/cli/issues/5252
GH_TOKEN: ${{ secrets.TEMP_JACOBS_GITHUB_PAT }}
# https://github.com/pkgxdev/cli/issues/5252
GH_TOKEN: ${{ secrets.GH_TOKEN }}
- uses: actions/upload-artifact@v3
with:
name: srcs
Expand All @@ -69,18 +69,15 @@ jobs:
runs-on: ${{ matrix.platform.os }}
name: ${{ matrix.platform.build-id }}
env:
FILENAME: tea-${{ github.event.inputs.version }}+${{ matrix.platform.build-id }}.tar.xz
FILENAME: pkgx-${{ github.event.inputs.version }}+${{ matrix.platform.build-id }}.tar.xz
steps:
- uses: actions/download-artifact@v3
with:
name: srcs

- run: tar xJf tea-${{ github.event.inputs.version }}.tar.xz --strip-components=1
- run: tar xJf pkgx-${{ github.event.inputs.version }}.tar.xz --strip-components=1

- uses: teaxyz/setup@v0
with:
srcroot: null # due to v0/v1 issues here will be fixed with setup@v1
+: deno.land
- uses: pkgxdev/setup@v0

- run: deno task compile

Expand All @@ -92,22 +89,22 @@ jobs:

# codesign always fails for deno binaries, even though it
# signs fine. See https://github.com/denoland/deno/issues/575
- run: codesign --sign "$APPLE_IDENTITY" --force --preserve-metadata=entitlements,requirements,flags,runtime ./tea || true
- run: codesign --sign "$APPLE_IDENTITY" --force --preserve-metadata=entitlements,requirements,flags,runtime ./pkgx || true
env:
APPLE_IDENTITY: ${{ secrets.APPLE_IDENTITY }}

- name: sanity check
run: test "$(./tea --version)" = "tea ${{ github.event.inputs.version }}"
run: test "$(./pkgx --version)" = "pkgx ${{ github.event.inputs.version }}"

- run: tar cJf $FILENAME tea
- run: tar cJf $FILENAME pkgx

- name: GPG sign archive
run: |
./tea gpg-agent --daemon || true
./pkgx gpg-agent --daemon || true
echo $GPG_PRIVATE_KEY | \
base64 -d | \
./tea gpg --import --batch --yes
./tea gpg \
./pkgx gpg --import --batch --yes
./pkgx gpg \
--detach-sign --armor \
--local-user $GPG_KEY_ID \
$FILENAME
Expand All @@ -116,11 +113,11 @@ jobs:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}

- name: attach product to release
run: ./tea gh release upload --clobber
run: ./pkgx gh release upload --clobber
v${{ github.event.inputs.version }}
$FILENAME $FILENAME.asc
env:
# using this token rather than github.token due to `release not found` bug
# https://github.com/cli/cli/issues/5252
GH_TOKEN: ${{ secrets.TEMP_JACOBS_GITHUB_PAT }}
GH_REPO: teaxyz/cli
# https://github.com/pkgxdev/cli/issues/5252
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GH_REPO: pkgxdev/pkgx
Loading

0 comments on commit 683319b

Please sign in to comment.