Skip to content

Commit

Permalink
fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
nitro-neal committed Aug 25, 2023
2 parents 416f551 + 7f450d2 commit 1fb79e1
Show file tree
Hide file tree
Showing 13 changed files with 3,148 additions and 939 deletions.
56 changes: 22 additions & 34 deletions .github/workflows/alpha-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,9 @@ jobs:
name: NPM Publish
runs-on: ubuntu-latest

strategy:
matrix:
package:
[
"agent",
"api",
"common",
"credentials",
"crypto",
"dids",
"identity-agent",
"proxy-agent",
"user-agent",
]
env:
# Packages not listed here will be excluded from publishing
PACKAGES: "agent api common credentials crypto dids identity-agent proxy-agent user-agent"

steps:
- name: Checkout source
Expand All @@ -47,45 +36,44 @@ jobs:
- name: Install latest npm
run: npm install -g npm@latest

# Note - this is not required but it gives a clean failure prior to attempting a release if the GH workflow runner is not authenticated with NPMjs.com
# Note - this is not required but it gives a clean failure prior to attempting a release if
# the GH workflow runner is not authenticated with NPMjs.com
- name: Verify NPM token is authenticated with NPMjs.com
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
run: npm whoami

- name: Fetch the version in the GitHub repo's package.json file
- name: Generate alpha version string and modify packages
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
run: |
cd packages/${{ matrix.package }}
REPO_VERSION=$(node -p "require('./package.json').version")
echo "REPO_VERSION=$REPO_VERSION" >> $GITHUB_ENV
echo "Repo Version: $REPO_VERSION"
shell: bash

- name: Generate the alpha version string
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
run: |
cd packages/${{ matrix.package }}
SHORT_COMMIT_SHA=$(git rev-parse --short HEAD)
YYYYMMDD=$(date +'%Y%m%d')
ALPHA_VERSION="${{ env.REPO_VERSION }}-alpha-$YYYYMMDD-$SHORT_COMMIT_SHA"
echo "ALPHA_VERSION=$ALPHA_VERSION" >> $GITHUB_ENV
echo "Alpha Version: $ALPHA_VERSION"
for dir in packages/*; do
cd $dir
REPO_VERSION=$(node -p "require('./package.json').version")
ALPHA_VERSION="${REPO_VERSION}-alpha-$YYYYMMDD-$SHORT_COMMIT_SHA"
npm version $ALPHA_VERSION --no-git-tag-version
cd ../..
done
shell: bash

- name: Bump package.json @web5/* dependency versions
run: node ./scripts/bump-workspace.mjs

- name: Install dependencies
run: npm ci

- name: Build all workspace packages
run: npm run build

- name: Publish @web5/${{ matrix.package }}@${{ env.ALPHA_VERSION }}
- name: Publish selected @web5/* packages
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
run: |
cd packages/${{ matrix.package }}
npm version ${{ env.ALPHA_VERSION }} --no-git-tag-version
npm publish --tag alpha --no-git-tag-version --access public --provenance
for package in $PACKAGES; do
cd packages/$package
npm publish --tag alpha --no-git-tag-version --access public --provenance
cd ../..
done
shell: bash
Loading

0 comments on commit 1fb79e1

Please sign in to comment.