Skip to content

Commit

Permalink
Publishable NPM packages for mainnet (#8360)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhofman authored Sep 22, 2023
2 parents e669bb1 + 8f8782b commit c0e1089
Show file tree
Hide file tree
Showing 54 changed files with 566 additions and 430 deletions.
8 changes: 6 additions & 2 deletions .github/actions/restore-node/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ inputs:
description: 'The relative path to the agoric-sdk directory'
required: false
default: '.'
keep-endo:
description: 'Keep Endo repository after installing from it'
required: false
default: 'false'
xsnap-random-init:
description: Build xsnap binary with random memory init
required: false
Expand Down Expand Up @@ -75,7 +79,7 @@ runs:
- uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node-version }}
cache: 'yarn'
cache: yarn
cache-dependency-path: ${{ inputs.path }}/yarn.lock
- uses: kenchan0130/actions-system-info@master
id: system-info
Expand All @@ -100,7 +104,7 @@ runs:
# Replace the Endo packages with the ones built from the checked-out branch.
if test -e ~/endo; then
scripts/replace-packages.sh ~/endo
rm -rf ~/endo
${{ inputs.keep-endo }} || rm -rf ~/endo
fi
mkdir -p node_modules/.cache/agoric
date > node_modules/.cache/agoric/yarn-installed
Expand Down
29 changes: 19 additions & 10 deletions .github/workflows/after-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ on:
branches:
# $default-branch
- master
- release-pismo
- 'release-*'
workflow_dispatch:

jobs:
build:
Expand Down Expand Up @@ -54,14 +55,22 @@ jobs:
run: npm whoami
- name: publish to NPM tag
run: |
if [ "${{ github.ref_name }}" = "release-pismo" ]; then
# A pismo dev release.
TAG=pismo-dev
else
# Just a dev release.
TAG=dev
fi
yarn lerna publish --conventional-prerelease --canary --exact \
case $GITHUB_REF_NAME in
release-*)
# A pre-release.
TAG=${GITHUB_REF_NAME#release-}-dev
;;
master)
# A trunk dev release.
TAG=dev
;;
*)
# Some other dev release.
TAG=other-dev
;;
esac
# without concurrency until https://github.com/Agoric/agoric-sdk/issues/8091
yarn lerna publish --concurrency 1 --conventional-prerelease --canary --exact \
--dist-tag=$TAG --preid=$TAG-$(git rev-parse --short=7 HEAD) \
--no-push --no-verify-access --yes
- name: notify on failure
Expand Down Expand Up @@ -101,7 +110,7 @@ jobs:
- uses: nwtgck/[email protected]
with:
# Production deployment if a push or merged PR.
production-deploy: ${{github.event_name == 'push'}}
production-deploy: ${{ github.event_name == 'push' && github.ref_name == 'master' }}
publish-dir: coverage/html
# SECURITY: we don't want to hand out the Github token to this action.
# github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ag-solo-xs.yml.DISABLED
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
branches:
# $default-branch
- master
- release-pismo
- 'release-*'

jobs:
xs-build:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deployment-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
push:
branches:
- master
- release-pismo
- 'release-*'
- beta
tags:
- '@agoric/sdk@*'
Expand Down
25 changes: 16 additions & 9 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
# $default-branch
- master
- release-pismo
- 'release-*'
tags:
- '@agoric/sdk@*'
workflow_dispatch:
Expand Down Expand Up @@ -139,16 +139,23 @@ jobs:
id: docker-tags
run: |
set -ex
SDK_TAG=$(echo "${{ github.ref_name }}" | sed -ne 's!^@agoric/sdk@!!p')
SDK_TAG=$(echo "$GITHUB_REF_NAME" | sed -ne 's!^@agoric/sdk@!!p')
case $SDK_TAG in
"")
if [ "${{ github.ref_name }}" = "release-pismo" ]; then
# A pismo dev release.
DOCKER_TAGS=pismo-dev
else
# Just a dev release.
DOCKER_TAGS=dev
fi
case $GITHUB_REF_NAME in
release-*)
# A pre-release.
DOCKER_TAGS=${GITHUB_REF_NAME#release-}-dev
;;
master)
# A trunk dev release.
DOCKER_TAGS=dev
;;
*)
# Some other dev release.
DOCKER_TAGS=other-dev
;;
esac
;;
*)
# A tagged SDK release.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
branches:
# $default-branch
- master
- release-pismo
- 'release-*'
pull_request:
merge_group:
permissions:
Expand Down
72 changes: 15 additions & 57 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ on:
push:
branches:
- master
- release-pismo
- 'release-*'
- beta
tags:
- '@agoric/sdk@*'
pull_request:
types:
- opened
Expand All @@ -28,10 +30,10 @@ jobs:
if: needs.pre_check.outputs.should_run == 'true'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# FIXME: Use this to enable NPM deploys...
# cli: [link-cli, local-npm]
cli: [link-cli]
cli: [link-cli/yarn, registry/yarn, registry/npm, registry/npx]
timeout-minutes: 40
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -41,17 +43,10 @@ jobs:
shell: bash

# Prerequisites

- uses: actions/setup-node@v3
with:
node-version: '16.x'
- name: cache node modules
uses: actions/cache@v3
- uses: ./.github/actions/restore-node
with:
path: ~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
node-version: 16.x
keep-endo: 'true'

# Select a branch on dapp to test against by adding text to the body of the
# pull request. For example: #dapp-encouragement-branch: zoe-release-0.7.0
Expand All @@ -74,53 +69,16 @@ jobs:
console.log(branch);
return branch;
# 'yarn install' must be done at the top level, to build all the
# cross-package symlinks
- run: yarn install --frozen-lockfile
- run: yarn build

- name: Link Agoric CLI from SDK
if: ${{ matrix.cli == 'link-cli' }}
run: |
yarn link-cli "$HOME/bin/agoric"
echo "AGORIC_CMD=[\"$HOME/bin/agoric\"]" >> $GITHUB_ENV
- name: Start local NPM registry
if: ${{ matrix.cli == 'local-npm' }}
if: ${{ startsWith(matrix.cli, 'registry') }}
run: |
tmp_registry_log=`mktemp`
nohup npx verdaccio@^5.4.0 &>$tmp_registry_log &
# Wait for `verdaccio` to boot
grep -q 'http address' <(tail -f $tmp_registry_log)
# Set registry to local registry
npm set registry http://localhost:4873
yarn config set registry http://localhost:4873
# Login so we can publish packages
npx npm-cli-login@^1.0.0 -u user -p password -e [email protected] \
-r http://localhost:4873 --quotes
npm whoami
yarn lerna publish --conventional-prerelease --canary --exact \
--dist-tag=blah --preid=dev-$(git rev-parse --short=7 HEAD) \
--no-push --no-verify-access --yes
yarn global add agoric@blah </dev/null
# Use the locally-installed dist-tag.
echo 'AGORIC_INSTALL_OPTIONS=["blah"]' >> $GITHUB_ENV
echo 'AGORIC_START_OPTIONS=["--rebuild"]' >> $GITHUB_ENV
echo 'AGORIC_CMD=["agoric"]' >> $GITHUB_ENV
set -xe
git reset --hard HEAD
git config user.email "[email protected]"
REGISTRY_PUBLISH_WORKSPACES="$HOME/endo" scripts/registry.sh bg-publish ${{ matrix.cli }}
- name: run agoric-cli integration-test
working-directory: ./packages/agoric-cli
run: yarn integration-test
env:
AGORIC_INIT_OPTIONS: '["--dapp-branch=${{steps.get-branch.outputs.result}}"]'
# Try to avoid hitting a pessimal Actions output rate-limitation.
SOLO_MAX_DEBUG_LENGTH: '1024'
run: scripts/registry.sh test ${{ matrix.cli }} ${{steps.get-branch.outputs.result}}

- name: notify on failure
if: >
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-check-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
contains(github.event.pull_request.labels.*.name, 'force:integration') || (
(
github.event.pull_request.base.ref == 'master' ||
github.event.pull_request.base.ref == 'release-pismo' ||
startsWith(github.event.pull_request.base.ref, 'release-') ||
github.event.pull_request.base.ref == 'beta'
) &&
github.event.pull_request.draft == false &&
Expand Down
15 changes: 0 additions & 15 deletions .github/workflows/test-all-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,6 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

##################
# NPM pack tests
# Check that all the packages can be packed to publish
npm-pack:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/restore-node
with:
node-version: '18.x'

- name: npm pack
run: yarn lerna exec yarn pack

##################
# Lint tests
# We run per package bc of https://github.com/typescript-eslint/typescript-eslint/issues/1192
Expand Down
3 changes: 2 additions & 1 deletion MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ to pass.

```sh
# Publish to NPM. NOTE: You may have to repeat this several times if there are failures.
yarn lerna publish from-package
# without concurrency until https://github.com/Agoric/agoric-sdk/issues/8091
yarn lerna publish --concurrency 1 from-package
```

- [ ] Merge the release PR into the base branch. DO NOT REBASE OR SQUASH OR YOU WILL LOSE
Expand Down
8 changes: 7 additions & 1 deletion golang/cosmos/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,18 @@ ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=$(VersionName) \
-X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)"

gcflags =
shared_ldflags = $(ldflags)

ifneq ($(GO_DEBUG),)
ldflags += -compressdwarf=false
gcflags += -N -l
else ifeq ($(shell uname -s 2>/dev/null),Darwin)
# Darwin's latest ld crashes with https://github.com/Agoric/agoric-sdk/issues/8367
shared_ldflags += -w
endif

BUILD_FLAGS := -tags "$(build_tags)" -gcflags '$(gcflags)' -ldflags '$(ldflags)'
SHARED_BUILD_FLAGS := -tags "$(build_tags)" -gcflags '$(gcflags)' -ldflags '$(shared_ldflags)'

all: compile-chain

Expand Down Expand Up @@ -69,7 +74,8 @@ compile-gyp:
rm -f binding.gyp

compile-libdaemon: go-mod-cache
go build -v $(MOD_READONLY) $(BUILD_FLAGS) -buildmode=c-shared -o build/libagcosmosdaemon.so ./cmd/libdaemon/main.go
go build -v $(MOD_READONLY) $(SHARED_BUILD_FLAGS) -buildmode=c-shared \
-o build/libagcosmosdaemon.so ./cmd/libdaemon/main.go

go-mod-cache: go.sum
@echo "--> Download go modules to local cache"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"type": "module",
"packageManager": "[email protected]",
"devDependencies": {
"@endo/eslint-plugin": "^0.4.3",
"@endo/eslint-plugin": "0.4.3",
"@jessie.js/eslint-plugin": "^0.3.0",
"@types/node": "^16.13.0",
"@typescript-eslint/parser": "^5.55.0",
Expand Down
12 changes: 6 additions & 6 deletions packages/ERTP/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@
"@agoric/store": "^0.9.3-u11.0",
"@agoric/swingset-vat": "^0.32.3-u11.0",
"@agoric/vat-data": "^0.5.3-u11.0",
"@endo/eventual-send": "^0.17.2",
"@endo/far": "^0.2.18",
"@endo/marshal": "^0.8.5",
"@endo/nat": "^4.1.27",
"@endo/promise-kit": "^0.2.56"
"@endo/eventual-send": "0.17.2",
"@endo/far": "0.2.18",
"@endo/marshal": "0.8.5",
"@endo/nat": "4.1.27",
"@endo/promise-kit": "0.2.56"
},
"devDependencies": {
"@endo/bundle-source": "^2.5.1",
"@endo/bundle-source": "2.5.2-upstream-rollup",
"@fast-check/ava": "^1.1.3",
"ava": "^5.2.0",
"tsd": "^0.28.1"
Expand Down
28 changes: 14 additions & 14 deletions packages/SwingSet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,20 @@
"@agoric/vat-data": "^0.5.3-u11.0",
"@agoric/xsnap": "^0.14.3-u11.0",
"@agoric/xsnap-lockdown": "^0.14.0",
"@endo/base64": "^0.2.31",
"@endo/bundle-source": "^2.5.1",
"@endo/captp": "^3.1.1",
"@endo/check-bundle": "^0.2.18",
"@endo/compartment-mapper": "^0.8.4",
"@endo/eventual-send": "^0.17.2",
"@endo/far": "^0.2.18",
"@endo/import-bundle": "^0.3.4",
"@endo/init": "^0.5.56",
"@endo/marshal": "^0.8.5",
"@endo/nat": "^4.1.27",
"@endo/promise-kit": "^0.2.56",
"@endo/zip": "^0.2.31",
"@endo/base64": "0.2.31",
"@endo/bundle-source": "2.5.2-upstream-rollup",
"@endo/captp": "3.1.1",
"@endo/check-bundle": "0.2.18",
"@endo/compartment-mapper": "0.8.4",
"@endo/eventual-send": "0.17.2",
"@endo/far": "0.2.18",
"@endo/import-bundle": "0.3.4",
"@endo/init": "0.5.56",
"@endo/marshal": "0.8.5",
"@endo/nat": "4.1.27",
"@endo/promise-kit": "0.2.56",
"@endo/ses-ava": "0.2.40",
"@endo/zip": "0.2.31",
"ansi-styles": "^6.2.1",
"anylogger": "^0.21.0",
"import-meta-resolve": "^2.2.1",
Expand All @@ -59,7 +60,6 @@
"tmp": "^0.2.1"
},
"peerDependencies": {
"@endo/ses-ava": "^0.2.40",
"ava": "^5.2.0"
},
"files": [
Expand Down
Loading

0 comments on commit c0e1089

Please sign in to comment.