Skip to content

Commit b046464

Browse files
committed
README tweaks; cd fixes
1 parent 4e4c73e commit b046464

3 files changed

Lines changed: 31 additions & 15 deletions

File tree

.github/deno-to-node.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ await build({
4646
"./src/utils/flock.deno.ts": "./src/utils/flock.node.ts"
4747
},
4848
package: {
49-
name: "libtea",
49+
name: "@teaxyz/lib",
5050
version,
5151
description: "pkg primitives",
5252
license: "Apache-2.0",
5353
repository: {
5454
type: "git",
55-
url: "git+https://github.com/teaxyz/lib.git",
55+
url: "git://github.com/teaxyz/lib.git",
5656
},
5757
bugs: {
5858
url: "https://github.com/teaxyz/lib/issues",
@@ -64,6 +64,9 @@ await build({
6464
devDependencies: {
6565
"@types/fs-ext": "^2"
6666
},
67+
publishConfig: {
68+
registry: "https://npm.pkg.github.com"
69+
},
6770
},
6871
postBuild() {
6972
Deno.copyFileSync("LICENSE.txt", "dist/LICENSE.txt");

.github/workflows/cd.yml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ name: CD
33
on:
44
release:
55
types:
6-
- published
6+
- created
7+
- edited
78

89
permissions:
910
packages: write
@@ -20,17 +21,27 @@ jobs:
2021
- uses: actions/checkout@v3
2122
- uses: teaxyz/setup@v0
2223

24+
- uses: actions/setup-node@v3
25+
with:
26+
node-version: 16
27+
registry-url: https://npm.pkg.github.com/
28+
2329
- name: build
2430
run: .github/deno-to-node.ts ${{ github.event.release.tag_name }}
2531

26-
- name: configure npm
27-
run: |
28-
npm config set @teaxyz:registry https://npm.pkg.github.com
29-
echo "//npm.pkg.github.com/:_authToken=${{ github.token }}" >> .npmrc
30-
working-directory: dist
31-
3232
- run: npm publish
3333
working-directory: dist
34+
env:
35+
NODE_AUTH_TOKEN: ${{github.token}}
36+
37+
# provided by ChatGPT
38+
- name: Convert pre-release to release
39+
run: |
40+
curl -X PATCH \
41+
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
42+
-H "Accept: application/vnd.github.v3+json" \
43+
-d '{"draft": false}' \
44+
"https://api.github.com/repos/${{ github.repository }}/releases/${{ github.event.release.id }}"
3445
3546
tagger:
3647
permissions:

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<a href="https://discord.tea.xyz">
88
<img src="https://img.shields.io/discord/906608167901876256?label=discord&color=1bcf6f&logo=discord&logoColor=fff" alt="Discord" />
99
</a>
10-
<a href='https://coveralls.io/github/teaxyz/cli?branch=main'>
10+
<a href='https://coveralls.io/github/teaxyz/lib?branch=main'>
1111
<img src='https://coveralls.io/repos/github/teaxyz/lib/badge.svg?branch=main' alt='Coverage Status' />
1212
</a>
1313
<a href="https://docs.tea.xyz">
@@ -25,18 +25,19 @@ without you or your user needing to install [tea/cli]
2525
## Importing libtea
2626

2727
```sh
28-
$ npm i @teaxyz/lib
28+
$ npm i https://github.com/teaxyz/libx
29+
# ^^ we’ll publish to npm after we’ve worked out the rough edges
2930
```
3031

31-
Or with deno:
32+
Or with Deno:
3233

3334
```ts
3435
import * as tea from "https://raw.github.com/teaxyz/lib/v0/mod.ts"
3536
```
3637

3738
## Usage
3839

39-
To install python 3.10 into `~/.tea`
40+
To install Python 3.10 into `~/.tea`
4041

4142
```ts
4243
import { prefab, semver, hooks } from "tea"
@@ -57,10 +58,10 @@ const { installed, pending } = await resolve(tree)
5758

5859
for (const pkg of pending) {
5960
const install = await install(pkg)
60-
installed.push(install)
6161
// ^^ install packages that aren’t yet installed
6262
// ^^ takes a logger parameter so you can show progress to the user
6363
// ^^ you could do these in parallel to speed things up
64+
installed.push(install)
6465
}
6566

6667
const { map, flatten } = useShellEnv()
@@ -79,8 +80,9 @@ import { hooks } from "tea"
7980
const { useConfig } = hooks
8081

8182
useConfig({ prefix: "/my/installation/directory" })
83+
// ^^ must be done before any other libtea calls
8284

83-
// now
85+
// now installs and env will use this prefix
8486
```
8587

8688
### Notes

0 commit comments

Comments
 (0)