Skip to content

Commit b1eefe9

Browse files
authored
Dev 1306 npm publish (#59)
1 parent 93cc587 commit b1eefe9

6 files changed

Lines changed: 99 additions & 10 deletions

File tree

.envrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
use flake
2+
3+
if [[ -f .env ]]; then
4+
dotenv .env
5+
fi
6+
7+
# Load secrets last to override any un-set values
8+
if [[ -f .secrets ]]; then
9+
dotenv .secrets
10+
fi

.github/workflows/publish.yaml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010

1111
permissions:
1212
contents: read
13-
packages: write
13+
id-token: write
1414

1515
jobs:
1616
publish:
@@ -23,8 +23,7 @@ jobs:
2323
uses: actions/setup-node@v4
2424
with:
2525
node-version: 22
26-
registry-url: https://npm.pkg.github.com
27-
scope: '@eqtylab'
26+
registry-url: https://registry.npmjs.org
2827

2928
- name: Setup pnpm
3029
uses: eqtylab-actions/setup-pnpm@master
@@ -39,17 +38,13 @@ jobs:
3938
PKG_VERSION=$(node -p "require('./packages/ui/package.json').version")
4039
echo "Checking $PKG_NAME@$PKG_VERSION"
4140
42-
if npm view "$PKG_NAME@$PKG_VERSION" version --registry=https://npm.pkg.github.com >/dev/null 2>&1; then
41+
if npm view "$PKG_NAME@$PKG_VERSION" version --registry=https://registry.npmjs.org >/dev/null 2>&1; then
4342
echo "exists=true" >> "$GITHUB_OUTPUT"
4443
echo "Version already exists; skipping publish."
4544
else
4645
echo "exists=false" >> "$GITHUB_OUTPUT"
4746
fi
48-
env:
49-
NODE_AUTH_TOKEN: ${{ secrets.GHCR_TOKEN }}
5047
5148
- name: Build and publish
5249
if: steps.version_check.outputs.exists != 'true'
5350
run: pnpm run release
54-
env:
55-
NODE_AUTH_TOKEN: ${{ secrets.GHCR_TOKEN }}

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ node_modules/.cache/
4747

4848
# Misc
4949
*.local
50-
50+
.direnv

flake.lock

Lines changed: 61 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
inputs = {
3+
flake-utils.url = "github:numtide/flake-utils";
4+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
5+
};
6+
7+
outputs = inputs:
8+
inputs.flake-utils.lib.eachDefaultSystem (system:
9+
let
10+
pkgs = (import (inputs.nixpkgs) { inherit system; });
11+
in {
12+
devShell = pkgs.mkShell {
13+
buildInputs=[
14+
pkgs.nodejs
15+
pkgs.nodePackages.pnpm
16+
pkgs.nodePackages.typescript
17+
pkgs.nodePackages.typescript-language-server
18+
];
19+
};
20+
}
21+
);
22+
}

packages/ui/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
],
3434
"sideEffects": false,
3535
"publishConfig": {
36-
"registry": "https://npm.pkg.github.com"
36+
"registry": "https://registry.npmjs.org",
37+
"access": "public"
3738
},
3839
"dependencies": {
3940
"@radix-ui/react-accordion": "^1.2.3",

0 commit comments

Comments
 (0)