Skip to content

Commit b96c1ad

Browse files
committed
Fix wkg installation, update gh auth for local use, include GH_USER
Signed-off-by: Aaron Wislang <aaron.wislang@microsoft.com>
1 parent a6bc8ba commit b96c1ad

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

scripts/publish.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,18 @@ cd tmp
66

77
# install wkg
88
git clone https://github.com/bytecodealliance/wasm-pkg-tools
9-
cd wasm-pkg-tools
9+
cd wasm-pkg-tools/crates/wkg
1010
cargo install --path .
11+
cd ../../../../
1112

1213
# login to the registry
13-
gh auth token | docker login ghcr.io --username yoshuawuyts --password-stdin
14+
# if running locally, we may need to:
15+
# gh auth refresh -h github.com -s write:packages,read:packages
16+
gh auth token | docker login ghcr.io --username YOURUSERNAME --password-stdin
1417

1518
# publish using wkg
1619
PROJECT_NAME="rust_wasi_hello"
17-
REGISTRY_REFERENCE="ghcr.io/yoshuawuyts/rust-wasi-hello:latest"
20+
GH_USER=$(gh api user --jq '.login')
21+
REGISTRY_REFERENCE="ghcr.io/${GH_USER}/rust-wasi-hello:latest"
22+
1823
wkg oci push $REGISTRY_REFERENCE target/wasm32-wasip1/release/$PROJECT_NAME.wasm

0 commit comments

Comments
 (0)