Skip to content

Commit 6d6e3fe

Browse files
committed
v1.1
1 parent 8f3a7fc commit 6d6e3fe

File tree

10 files changed

+97
-102
lines changed

10 files changed

+97
-102
lines changed

.github/workflows/cd.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- uses: actions/checkout@v4
18-
- run: curl -Ssf https://tea.xyz/$(uname)/$(uname -m).tgz | sudo tar xz -C /usr/local/bin
18+
- run: curl -Ssf https://pkgx.sh/$(uname)/$(uname -m).tgz | sudo tar xz -C /usr/local/bin
1919
- run: ./scripts/dist.sh --minify
20-
- uses: actions/upload-artifact@v2
20+
- uses: actions/upload-artifact@v3
2121
with:
2222
name: dist
2323
path: dist
@@ -37,7 +37,7 @@ jobs:
3737
env: aws
3838

3939
- uses: actions/checkout@v4
40-
- uses: actions/download-artifact@v2
40+
- uses: actions/download-artifact@v3
4141
with:
4242
name: dist
4343
path: dist
@@ -50,13 +50,13 @@ jobs:
5050

5151
- run:
5252
aws s3 cp
53-
./installer.sh s3://www.tea.xyz/pour.sh
53+
./installer.sh s3://www.pkgx.sh/installer.sh
5454
--metadata-directive REPLACE
5555
--cache-control no-cache,must-revalidate
5656
- run:
5757
aws cloudfront create-invalidation
5858
--distribution-id ${{ secrets.AWS_CF_DISTRIBUTION_ID }}
59-
--paths / /pour.sh
59+
--paths / /installer.sh
6060

6161
- uses: git-actions/set-user@v1
6262
- run: |

.github/workflows/ci.action.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@v4
1818
- run: ./scripts/dist.sh
19-
- uses: actions/upload-artifact@v2
19+
- uses: actions/upload-artifact@v3
2020
with:
2121
name: dist
2222
path: dist
@@ -26,12 +26,12 @@ jobs:
2626
runs-on: ubuntu-latest
2727
steps:
2828
- uses: actions/checkout@v4
29-
- uses: actions/download-artifact@v2
29+
- uses: actions/download-artifact@v3
3030
with:
3131
name: dist
3232
path: dist
3333
- uses: ./
34-
- run: tea --version
34+
- run: pkgx --version
3535

3636
plus-pkgs:
3737
needs: dist
@@ -55,19 +55,19 @@ jobs:
5555
container: ${{ matrix.container }}
5656
steps:
5757
- uses: actions/checkout@v4
58-
- uses: actions/download-artifact@v2
58+
- uses: actions/download-artifact@v3
5959
with:
6060
name: dist
6161
path: dist
6262

6363
- uses: ./
6464
with:
65-
TEA_DIR: ${{ matrix.prefix }}
65+
PKGX_DIR: ${{ matrix.prefix }}
6666
+: node@18 deno.land
6767

68-
- run: test -f '${{ matrix.prefix }}/tea.xyz/v*/bin/tea'
68+
- run: test -f '${{ matrix.prefix }}/pkgx.sh/v*/bin/pkgx'
6969
if: ${{ matrix.prefix }}
70-
- run: tea --version
70+
- run: pkgx --version
7171
- run: node --eval 'console.log(1)'
7272
- run: deno --version
7373

@@ -76,11 +76,11 @@ jobs:
7676
needs: dist
7777
steps:
7878
- uses: actions/checkout@v4
79-
- uses: actions/download-artifact@v2
79+
- uses: actions/download-artifact@v3
8080
with:
8181
name: dist
8282
path: dist
8383
- uses: ./
84-
- run: tea --version
84+
- run: pkgx --version
8585
- uses: ./
86-
- run: tea --version
86+
- run: pkgx --version

.github/workflows/ci.installer.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ permissions:
1313
contents: read
1414

1515
jobs:
16-
install-tea:
16+
install-pkgx:
1717
runs-on: ${{ matrix.os }}
1818
strategy:
1919
matrix:
@@ -24,16 +24,16 @@ jobs:
2424
- uses: actions/checkout@v4
2525
# using cat | sh to emulate the curl command we tell people to use
2626
- run: cat ./installer.sh | sh
27-
- run: tea --version
27+
- run: pkgx --version
2828

2929
usage-as-proxy:
3030
runs-on: ubuntu-latest
3131
steps:
3232
- uses: actions/checkout@v4
3333
- run: cat ./installer.sh | sh -s node --eval 'console.log(1)'
34-
- run: ./installer.sh sh -c "which tea"
34+
- run: ./installer.sh sh -c "which pkgx"
3535
- run: source <(cat ./installer.sh) duf
36-
- run: if command -v tea; then exit 1; fi
36+
- run: if command -v pkgx; then exit 1; fi
3737

3838
sudo-not-required:
3939
runs-on: ubuntu-latest
@@ -50,16 +50,16 @@ jobs:
5050
- uses: actions/checkout@v4
5151
- run: |
5252
eval "$(cat ./installer.sh)"
53-
tea +duf
53+
env +duf
5454
duf --version
5555
5656
test -n "$BASH_VERSION"
5757
test -z "$ZSH_VERSION"
5858
shell: bash -e {0}
5959
60-
# check tea was installed despite executing via `eval`
60+
# check pkgx was installed despite executing via `eval`
6161
- run:
62-
tea duf --version
62+
pkgx duf --version
6363

6464
eval-zsh:
6565
runs-on: ubuntu-latest
@@ -70,7 +70,7 @@ jobs:
7070
- uses: actions/checkout@v4
7171
- run: |
7272
eval "$(cat ./installer.sh)"
73-
tea +duf
73+
env +duf
7474
duf --version
7575
7676
test -n "$ZSH_VERSION"
@@ -83,7 +83,7 @@ jobs:
8383
- uses: actions/checkout@v4
8484
- run: |
8585
eval "$(cat ./installer.sh)"
86-
tea +duf
86+
env +duf
8787
duf --version
8888
8989
test -z "$ZSH_VERSION"
@@ -99,7 +99,7 @@ jobs:
9999
- name: check
100100
run: if touch /usr/local/bin/foo; then exit 1; fi
101101
- run: ./installer.sh
102-
- run: test "$(which tea)" = /usr/local/bin/tea
102+
- run: test "$(which pkgx)" = /usr/local/bin/pkgx
103103

104104
no-dirs:
105105
strategy:
@@ -110,7 +110,7 @@ jobs:
110110
- uses: actions/checkout@v4
111111
- run: sudo mv ${{ matrix.dir }} $(mktemp -d)
112112
- run: ./installer.sh
113-
- run: tea duf --version
113+
- run: pkgx duf --version
114114

115115
multiple-apply-is-ok:
116116
runs-on: ubuntu-latest
@@ -141,7 +141,7 @@ jobs:
141141
- fedora:latest
142142

143143
# - nixos/nix:latest can’t exec
144-
# - alpine:latest tea binary doesn’t actually end up on the system (wtf)
144+
# - alpine:latest pkgx binary doesn’t actually end up on the system (wtf)
145145
container: ${{ matrix.container }}
146146
steps:
147147
- uses: actions/checkout@v4
@@ -155,4 +155,4 @@ jobs:
155155
env:
156156
PATH: ${{ github.workspace }}/bin:/usr/bin:/bin
157157

158-
- run: tea node --eval 'console.log(1)'
158+
- run: pkgx node --eval 'console.log(1)'

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2022 tea.inc.
189+
Copyright 2022–23 pkgx.inc.
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
![tea](https://tea.xyz/banner.png)
1+
![pkgx](https://pkgx.dev/banner.png)
22

3-
* This repository provides the `tea` GitHub Action.
4-
* It also hosts [`installer.sh`](./installer.sh); the result of `curl tea.xyz`.
3+
* This repository provides the `pkgx` GitHub Action.
4+
* It also hosts [`installer.sh`](./installer.sh); the result of `curl pkgx.sh`.
55

66

77
# GitHub Action
88

99
```yaml
10-
- uses: teaxyz/setup@v1
10+
- uses: pkgxdev/setup@v1
1111
```
1212
13-
Installs the latest version of `tea`.
13+
Installs the latest version of `pkgx`.
1414

1515
See [`action.yml`] for all inputs and outputs, but here’s the usual ones:
1616

1717
```yaml
18-
- uses: teaxyz/setup@v1
18+
- uses: pkgxdev/setup@v1
1919
with:
2020
2121
```
@@ -25,39 +25,39 @@ See [`action.yml`] for all inputs and outputs, but here’s the usual ones:
2525
We cannot integrate with the GitHub Actions shell. But you probably don’t
2626
need it.
2727

28-
### Should you Cache `~/.tea`?
28+
### Should you Cache `~/.pkgx`?
2929

30-
No. tea packages are just tarballs. Caching is just a tarball. You’ll likely
30+
No. pkgx packages are just tarballs. Caching is just a tarball. You’ll likely
3131
just slow things down.
3232

3333
&nbsp;
3434

3535

36-
# `tea` Installer
36+
# `pkgx` Installer
3737

38-
To install `tea`:
38+
To install `pkgx`:
3939

4040
```sh
41-
$ curl https://tea.xyz | sh
41+
$ curl https://pkgx.sh | sh
4242
43-
# - installs to `/usr/local/bin/tea`
44-
# - if tea is already installed it’s a noop
43+
# - installs to `/usr/local/bin/pkgx`
44+
# - if pkgx is already installed it’s a noop
4545
```
4646

47-
To use `tea` to run a command in a temporary sandbox:
47+
To use `pkgx` to run a command in a temporary sandbox:
4848

4949
```sh
50-
$ curl -Ssf https://tea.xyz | sh -s -- gum spin -- sleep 5
50+
$ curl -Ssf https://pkgx.sh | sh -s -- gum spin -- sleep 5
5151

52-
# - if tea is installed, uses that installation to run gum
53-
# - if tea is *not* installed, downloads tea to a temporary location
54-
# - packages are still cached in `~/.tea` but tea itself is not installed
52+
# - if pkgx is installed, uses that installation to run gum
53+
# - if pkgx is *not* installed, downloads pkgx to a temporary location
54+
# - packages are still cached in `~/.pkgx` but pkgx itself is not installed
5555
```
5656

5757
This syntax is easier to remember:
5858

5959
```sh
60-
sh <(curl tea.xyz) gum spin -- sleep 5
60+
sh <(curl -L pkgx.sh) gum spin -- sleep 5
6161
```
6262

6363
> There is the **notable caveat** that it will not work with bash <4
@@ -66,4 +66,3 @@ sh <(curl tea.xyz) gum spin -- sleep 5
6666
> where bash is the shell interpreting your commands. Your call.
6767
6868
[`action.yml`]: ./action.yml
69-
[tea.xyz]: https://tea.xyz

action.ts

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { porcelain, hooks, Path, utils, PackageRequirement } from "@teaxyz/lib"
1+
import { porcelain, hooks, Path, utils, PackageRequirement } from "libpkgx"
22
import { exec } from "@actions/exec"
33
import * as core from '@actions/core'
44
import * as path from 'path'
@@ -9,14 +9,14 @@ const { install } = porcelain
99
const { flatmap } = utils
1010

1111
async function go() {
12-
const TEA_DIR = core.getInput('TEA_DIR')
12+
const PKGX_DIR = core.getInput('PKGX_DIR') || core.getInput('TEA_DIR')
1313

14-
let vtea = core.getInput('version') ?? ""
15-
if (vtea && !/^[*^~@=]/.test(vtea)) {
16-
vtea = `@${vtea}`
14+
let vpkgx = core.getInput('version') ?? ""
15+
if (vpkgx && !/^[*^~@=]/.test(vpkgx)) {
16+
vpkgx = `@${vpkgx}`
1717
}
1818

19-
const pkgs = [`tea.xyz${vtea}`]
19+
const pkgs = [`pkgx.sh${vpkgx}`]
2020
for (let key in process.env) {
2121
if (key.startsWith("INPUT_+")) {
2222
const value = process.env[key]!
@@ -32,19 +32,20 @@ async function go() {
3232

3333
// we build to /opt and special case this action so people new to
3434
// building aren’t immediately flumoxed
35-
if (TEA_DIR == '/opt' && os.platform() == 'darwin') {
35+
if (PKGX_DIR == '/opt' && os.platform() == 'darwin') {
3636
await exec('sudo', ['chown', `${os.userInfo().username}:staff`, '/opt'])
3737
}
3838

3939
core.info(`fetching ${pkgs.join(", ")}…`)
4040

41-
const prefix = flatmap(TEA_DIR, (x: string) => new Path(x)) ?? Path.home().join(".tea")
41+
const prefix = flatmap(PKGX_DIR, (x: string) => new Path(x)) ?? Path.home().join(".pkgx")
4242

4343
useConfig({
4444
prefix,
45+
data: prefix.join(".data"),
4546
cache: prefix.join(".cache"),
4647
pantries: [],
47-
UserAgent: 'tea.setup/0.1.0', //TODO version
48+
UserAgent: 'pkgx.setup/0.1.0', //TODO version
4849
options: { compression: 'gz' }
4950
})
5051
const { map, flatten } = useShellEnv()
@@ -63,8 +64,8 @@ async function go() {
6364
}
6465
}
6566

66-
if (TEA_DIR) {
67-
core.exportVariable('TEA_DIR', TEA_DIR)
67+
if (PKGX_DIR) {
68+
core.exportVariable('PKGX_DIR', PKGX_DIR)
6869
}
6970

7071
if (os.platform() != 'darwin') {
@@ -91,7 +92,7 @@ async function parse(input: string): Promise<PackageRequirement> {
9192
if (projects.length <= 0) throw new Error(`not found ${rawpkg.project}`)
9293
if (projects.length > 1) throw new Error(`ambiguous project ${rawpkg.project}`)
9394

94-
const project = projects[0].project //FIXME libtea forgets to correctly assign type
95+
const project = projects[0].project //FIXME libpkgx forgets to correctly assign type
9596
const constraint = rawpkg.constraint
9697

9798
return { project, constraint }

action.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,23 @@
1-
name: tea/setup
1+
name: pkgx/setup
22
description: >
3-
Installs tea.xyz to your GitHub Actions runner.
3+
Installs `pkgx` to your GitHub Actions runner.
44
inputs:
55
+:
66
description: |
77
Whitespace separated, pkgs to supplement the environment. eg.
88
99
```yaml
10-
+:
11-
12-
10+
1311
```
14-
15-
By default tea reads your developer environment and adds those packages.
16-
Specifying additional packages here is a way to augment that.
1712
required: false
18-
TEA_DIR:
13+
PKGX_DIR:
1914
description: >
2015
Where pkgs are cached.
21-
Defaults to `$HOME/.tea`.
16+
Defaults to `$HOME/.pkgx`.
2217
required: false
2318
version:
2419
description: >
25-
The version of teaxyz/cli to install.
20+
The version of `pkgx` to install.
2621
Defaults to the @latest.
2722
required: false
2823
runs:

0 commit comments

Comments
 (0)