File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020 - name : Checkout repository
2121 uses : actions/checkout@v2
2222
23+ - name : Login to GitHub Container Registry
24+ uses : docker/login-action@v3
25+ with :
26+ registry : ghcr.io
27+ username : ${{ github.actor }}
28+ password : ${{ secrets.GITHUB_TOKEN }}
29+
2330 - name : Cache cargo bin
2431 id : cache-cargo
2532 uses : actions/cache@v3
4249 run : bash scripts/build.sh
4350
4451 - name : Run publish script
45- env :
46- GH_TOKEN : ${{ github.token }}
4752 run : bash scripts/publish.sh
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- # login to the registry
4- # if running locally, we may need to:
5- # gh auth refresh -h github.com -s write:packages,read:packages
6- gh auth token | docker login ghcr.io --username YOURUSERNAME --password-stdin
7-
8- # publish using wkg
9- PROJECT_NAME=" rust_wasi_hello"
10-
11- if [ -z " $IMAGE_NAME " ]; then
12- GH_USER=$( gh api user --jq ' .login' )
13- IMAGE_NAME=" ${GH_USER} /rust-wasi-hello"
14- export IMAGE_NAME
3+ # not running in github actions? use gh cli to login, etc, locally
4+ if [ " $GITHUB_ACTIONS " != " true" ]; then
5+ # login to the registry
6+ # if running locally, we may need to:
7+ # gh auth refresh -h github.com -s write:packages,read:packages
8+ gh auth token | docker login ghcr.io --username YOURUSERNAME --password-stdin
9+ GH_USER=$( gh api user --jq ' .login' )
10+ IMAGE_NAME=" ${GH_USER} /rust-wasi-hello"
1511fi
1612
13+ PROJECT_NAME=" rust_wasi_hello"
1714REGISTRY_REFERENCE=" ghcr.io/${IMAGE_NAME} :latest"
1815
1916wkg oci push $REGISTRY_REFERENCE target/wasm32-wasip1/release/$PROJECT_NAME .wasm
You can’t perform that action at this time.
0 commit comments