Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install Packages post release #482

Merged
merged 33 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
04a9726
install immediately after releasing
aaronmgdr Nov 14, 2024
202596f
make sure packages can be build for publishing
aaronmgdr Nov 14, 2024
c279d0f
remove checking betas on each pr
aaronmgdr Nov 14, 2024
c588d6b
add make script because yarn workspace commands must call a script in…
aaronmgdr Nov 15, 2024
1cec6c3
fix file path
aaronmgdr Nov 15, 2024
73862db
better commands and wording
aaronmgdr Dec 10, 2024
165f625
i was wrong about how matrix works before
aaronmgdr Dec 10, 2024
68e379d
modify release temporarily to test new job
aaronmgdr Dec 10, 2024
950c331
make it run
aaronmgdr Dec 10, 2024
4b39953
typo
aaronmgdr Dec 10, 2024
738dfe7
should do it
aaronmgdr Dec 10, 2024
251bdeb
another
aaronmgdr Dec 10, 2024
32f722b
stringify
aaronmgdr Dec 10, 2024
395ca18
fix typo
aaronmgdr Dec 10, 2024
cb18478
nooo
aaronmgdr Dec 10, 2024
fedb4b7
wip
aaronmgdr Dec 10, 2024
46e8d96
install jq
aaronmgdr Dec 10, 2024
9f03b7d
print
aaronmgdr Dec 10, 2024
265f548
format jq
aaronmgdr Dec 10, 2024
204c451
fix jq expression
aaronmgdr Dec 10, 2024
e2b0702
boom
aaronmgdr Dec 10, 2024
8319747
remove most fake data
aaronmgdr Dec 10, 2024
d50209e
yolo
aaronmgdr Dec 10, 2024
4411869
conditional
aaronmgdr Dec 10, 2024
87eca61
debug
aaronmgdr Dec 11, 2024
6b1879d
fix up issues
aaronmgdr Dec 11, 2024
99fcc83
do not run if not needed
aaronmgdr Dec 11, 2024
a1e5788
installing isnt gonna work for testing unless we re implement changes…
aaronmgdr Dec 11, 2024
a8ca77a
use test data for easier review
aaronmgdr Dec 11, 2024
ce98d5d
use test data
aaronmgdr Dec 11, 2024
c46a27b
full test data
aaronmgdr Dec 11, 2024
120e75a
reverse package packing on pr
aaronmgdr Dec 11, 2024
42def9e
take off the training wheels
aaronmgdr Dec 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,22 @@ jobs:
cd $RUNNER_TEMP
npm install $RUNNER_WORKSPACE/developer-tooling/packages/sdk/base/*.tgz
npm install $RUNNER_WORKSPACE/developer-tooling/packages/sdk/utils/*.tgz
pack-packages:
name: Build Package tarballs for dry run
runs-on: ['self-hosted', 'org', '8-cpu']
needs: install-dependencies
steps:
- uses: actions/checkout@v4
- name: Sync workspace
uses: ./.github/actions/sync-workspace
with:
artifacts_to_cache: ${{ needs.install-dependencies.outputs.artifacts_to_cache }}
- name: Pack all packages into tarballs
run: |
pwd
mkdir -p ${{ github.workspace }}/artifacts
yarn workspaces foreach --all run make --out ${{ github.workspace }}/artifacts/%s-%v.tgz
aaronmgdr marked this conversation as resolved.
Show resolved Hide resolved


validate-renovate-config:
name: Validate Renovate Config
Expand Down
40 changes: 0 additions & 40 deletions .github/workflows/cron-npm-install.yml

This file was deleted.

74 changes: 69 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Release Packages

on:
# REMOVE
pull_request:
push:
branches:
- master
Expand All @@ -18,7 +20,11 @@ jobs:
pull-requests: write
repository-projects: write
outputs:
publishedPackages: ${{ steps.changesets.outputs.publishedPackages }}
publishedPackages: '[{"name": "@celo/celocli", "version": "beta"}, {"name": "@celo/viem-account-ledger", "version": "1.0.0-beta.2"}, {"name": "@celo/utils", "version": "7.0.0"}, {"name": "@celo/contractkit", "version": "8.3.1"}]'
shazarre marked this conversation as resolved.
Show resolved Hide resolved
published: 'true'
# publishedPackages: ${{ steps.changesets.outputs.publishedPackages }}
# published: ${{ steps.changesets.outputs.published }}

steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand All @@ -30,22 +36,23 @@ jobs:
api-url: https://api.gateway.akeyless.celo-networks-dev.org
access-id: p-kf9vjzruht6l
static-secrets: '{"/static-secrets/NPM/npm-publish-token":"NPM_TOKEN"}'
- name: Setup Node.js 18.x
- name: Setup Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: 20.x
- name: 'enable corepack for yarn'
run: sudo corepack enable yarn
shell: bash
# must call twice because of chicken and egg problem with yarn and node
- uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '20'
cache: 'yarn'
- name: Install Dependencies
shell: bash
run: yarn
- name: Create Release Pull Request or Publish to npm
if: ${{ github.event_name == 'nevereverever' }}
id: changesets
uses: changesets/action@v1
env:
Expand All @@ -55,10 +62,67 @@ jobs:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: yarn release
version: yarn version-and-reinstall

# release gives an array of published packages as jsob objects, we need an array of strings for installing
prepare:
name: Format Output for Install
if: needs.release.outputs.published
needs: release
runs-on: ubuntu-latest
container:
image: node:20-bullseye
shazarre marked this conversation as resolved.
Show resolved Hide resolved
outputs:
result: "${{ steps.map.outputs.output }}"
steps:
- name: Install jq
if: needs.release.outputs.published
uses: dcarbone/install-jq-action@v3.0.1
- name: Format Published Packages Array
if: needs.release.outputs.published
uses: cloudposse/github-action-jq@main
id: map
with:
compact: true
raw-output: true
input: '${{ needs.release.outputs.publishedPackages }}'
script: |-
map("\(.name)@\(.version)")

# last line of defense to ensure that the packages were published correctly
install-released-packages:
name: Install Released Packages
needs: [prepare, release]
if: ${{ needs.release.outputs.published }} == 'true'
runs-on: ubuntu-latest
container:
image: node:20-bullseye
strategy:
fail-fast: false
max-parallel: 12
matrix:
package: ${{fromJson(needs.prepare.outputs.result)}}
steps:
- name: Install @celo/celocli dependencies
if: contains(matrix.package, '@celo/celocli')
run: |
apt update
apt install -y libusb-1.0-0-dev libudev-dev
npm install node-gyp --global

- name: Installing ${{ matrix.package }} package
run: npm install ${{ matrix.package }} --global
- name: Ensure sample of celocli commands run
shazarre marked this conversation as resolved.
Show resolved Hide resolved
if: contains(matrix.package, '@celo/celocli')
run: |
celocli --version
celocli account:new
echo "checking celo community fund balance"
celocli account:balance 0xD533Ca259b330c7A88f74E000a3FaEa2d63B7972 --node celo
celocli network:whitelist --node alfajores

open-docs-pr:
needs: release
if: ${{ contains(fromJson(needs.release.outputs.publishedPackages).*.name, '@celo/cli') }}
if: ${{ contains(fromJson(needs.release.outputs.publishedPackages).*.name, '@celo/celocli') }}
uses: celo-org/developer-tooling/.github/workflows/open-docs-pr.yml@master
with:
commit: ${{ github.sha }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,4 @@ gha-creds-*.json
transactions.json
packages/sdk/metadata-claims/lib
packages/cli/key
package.tgz
3 changes: 2 additions & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"docs": "./generate_docs.sh",
"lint": "yarn run --top-level eslint -c .eslintrc.js ",
"prepublish": "",
"prepack": "yarn build && oclif readme",
"make": "yarn pack",
"prepack": "yarn run build && oclif readme",
"test": "TZ=UTC NODE_OPTIONS='--experimental-vm-modules' yarn jest --runInBand --forceExit",
"test-anvil": "RUN_GANACHE_TESTS=false RUN_ANVIL_TESTS=true TZ=UTC NODE_OPTIONS='--experimental-vm-modules' yarn jest --forceExit",
"test-ganache": "RUN_GANACHE_TESTS=true RUN_ANVIL_TESTS=false TZ=UTC NODE_OPTIONS='--experimental-vm-modules' yarn jest --runInBand --forceExit",
Expand Down
1 change: 1 addition & 0 deletions packages/dev-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"lib/*"
],
"scripts": {
"make": "yarn pack",
"build": "yarn run --top-level tsc -b .",
"lint": "yarn run --top-level eslint -c .eslintrc.js ",
"prepack": "yarn build"
Expand Down
1 change: 1 addition & 0 deletions packages/sdk/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"homepage": "https://docs.celo.org/developer/tools#celo-sdk-reference-docs",
"repository": "https://github.com/celo-org/developer-tooling/tree/master/packages/sdk/base",
"scripts": {
"make": "yarn pack",
"prepublishOnly": "yarn build",
"build": "yarn run --top-level tsc -b .",
"clean": "yarn run --top-level tsc -b . --clean",
Expand Down
1 change: 1 addition & 0 deletions packages/sdk/connect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"blockchain"
],
"scripts": {
"make": "yarn pack",
"build": "yarn run --top-level tsc -b .",
"clean": "yarn run --top-level tsc -b . --clean",
"docs": "yarn run --top-level typedoc",
Expand Down
1 change: 1 addition & 0 deletions packages/sdk/contractkit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"contractkit"
],
"scripts": {
"make": "yarn pack",
"build:ts": "yarn run --top-level tsc -b .",
"build": "yarn run --top-level tsc -b .",
"clean": "yarn run --top-level tsc -b . --clean",
Expand Down
1 change: 1 addition & 0 deletions packages/sdk/cryptographic-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"homepage": "https://celo-sdk-docs.readthedocs.io/en/latest/cryptographic-utils",
"repository": "https://github.com/celo-org/developer-tooling/tree/master/packages/sdk/cryptographic-utils",
"scripts": {
"make": "yarn pack",
"prepublishOnly": "yarn build",
"build": "yarn run --top-level tsc -b .",
"docs": "yarn run --top-level typedoc",
Expand Down
1 change: 1 addition & 0 deletions packages/sdk/explorer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"contractkit"
],
"scripts": {
"make": "yarn pack",
"build": "yarn run --top-level tsc -b .",
"clean": "yarn run --top-level tsc -b . --clean",
"docs": "yarn run --top-level typedoc",
Expand Down
1 change: 1 addition & 0 deletions packages/sdk/governance/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"blockchain"
],
"scripts": {
"make": "yarn pack",
"build": "yarn run --top-level tsc -b .",
"clean": "yarn run --top-level tsc -b . --clean",
"docs": "yarn run --top-level typedoc",
Expand Down
1 change: 1 addition & 0 deletions packages/sdk/keystores/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"homepage": "https://docs.celo.org/developer/tools",
"repository": "https://github.com/celo-org/developer-tooling/tree/master/packages/sdk/keystores",
"scripts": {
"make": "yarn pack",
"build": "yarn run --top-level tsc -b .",
"clean": "yarn run --top-level tsc -b . --clean",
"docs": "yarn run --top-level typedoc",
Expand Down
1 change: 1 addition & 0 deletions packages/sdk/metadata-claims/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"types": "./lib/index.d.ts",
"sideEffects": false,
"scripts": {
"make": "yarn pack",
"build": "yarn tsc -b .",
"clean": "rm -rf lib ; yarn run tsc -b . --clean",
"prepublishOnly": "yarn build",
Expand Down
1 change: 1 addition & 0 deletions packages/sdk/network-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"contractkit"
],
"scripts": {
"make": "yarn pack",
"build": "yarn run --top-level tsc -b .",
"clean": "yarn run --top-level tsc -b . --clean",
"docs": "yarn run --top-level typedoc",
Expand Down
1 change: 1 addition & 0 deletions packages/sdk/phone-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"homepage": "https://docs.celo.org/developer/tools",
"repository": "https://github.com/celo-org/developer-tooling/tree/master/packages/sdk/phone-utils",
"scripts": {
"make": "yarn pack",
"prepublishOnly": "yarn build",
"build": "yarn run --top-level tsc -b .",
"clean": "yarn run --top-level tsc -b . --clean",
Expand Down
1 change: 1 addition & 0 deletions packages/sdk/transactions-uri/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"contractkit"
],
"scripts": {
"make": "yarn pack",
"build": "yarn run --top-level tsc -b .",
"clean": "yarn run --top-level tsc -b . --clean",
"docs": "yarn run --top-level typedoc",
Expand Down
1 change: 1 addition & 0 deletions packages/sdk/wallets/wallet-hsm-aws/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"sdk"
],
"scripts": {
"make": "yarn pack",
"build": "yarn run --top-level tsc -b .",
"clean": "yarn run --top-level tsc -b . --clean",
"docs": "yarn run --top-level typedoc",
Expand Down
1 change: 1 addition & 0 deletions packages/sdk/wallets/wallet-hsm-azure/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"sdk"
],
"scripts": {
"make": "yarn pack",
"build": "yarn run --top-level tsc -b .",
"clean": "yarn run --top-level tsc -b . --clean",
"docs": "yarn run --top-level typedoc",
Expand Down
1 change: 1 addition & 0 deletions packages/sdk/wallets/wallet-hsm-gcp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"sdk"
],
"scripts": {
"make": "yarn pack",
"build": "yarn run --top-level tsc -b .",
"clean": "yarn run --top-level tsc -b . --clean",
"docs": "yarn run --top-level typedoc",
Expand Down
1 change: 1 addition & 0 deletions packages/sdk/wallets/wallet-hsm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"sdk"
],
"scripts": {
"make": "yarn pack",
"build": "yarn run --top-level tsc -b .",
"clean": "yarn run --top-level tsc -b . --clean",
"docs": "yarn run --top-level typedoc",
Expand Down
1 change: 1 addition & 0 deletions packages/sdk/wallets/wallet-ledger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"sdk"
],
"scripts": {
"make": "yarn pack",
"prebuild": "ts-node scripts/generate-tokens-all-networks.ts",
"build": "yarn run --top-level tsc -b .",
"clean": "yarn run --top-level tsc -b . --clean",
Expand Down
1 change: 1 addition & 0 deletions packages/sdk/wallets/wallet-local/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"sdk"
],
"scripts": {
"make": "yarn pack",
"build": "yarn run --top-level tsc -b .",
"clean": "yarn run --top-level tsc -b . --clean",
"docs": "yarn run --top-level typedoc",
Expand Down
1 change: 1 addition & 0 deletions packages/sdk/wallets/wallet-remote/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"sdk"
],
"scripts": {
"make": "yarn pack",
"build": "yarn run --top-level tsc -b .",
"clean": "yarn run --top-level tsc -b . --clean",
"docs": "yarn run --top-level typedoc",
Expand Down
1 change: 1 addition & 0 deletions packages/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"license": "Apache-2.0",
"main": "tsconfig.json",
"scripts": {
"make": "yarn pack",
"build-rules": "tsc"
}
}
1 change: 1 addition & 0 deletions packages/viem-account-ledger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"ledger"
],
"scripts": {
"make": "yarn pack",
"build": "yarn build:cjs && yarn build:esm",
"build:cjs": "yarn --top-level run tsc -m commonjs",
"build:esm": "yarn --top-level run tsc -m ES6 --outDir lib-es",
Expand Down
Loading