Skip to content

Commit

Permalink
Prepare poly repo for first release
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Hinek <[email protected]>
  • Loading branch information
frankhinek committed May 16, 2023
1 parent 90891af commit 71937dc
Show file tree
Hide file tree
Showing 38 changed files with 2,399 additions and 383 deletions.
35 changes: 0 additions & 35 deletions .github/workflows/ci-test.yml

This file was deleted.

32 changes: 16 additions & 16 deletions .github/workflows/docs-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: Build and Deploy Docs

on:
# Runs on pushes targeting the default branch
push:
branches:
- main
# push:
# branches:
# - main

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -17,28 +17,28 @@ concurrency:
cancel-in-progress: false

jobs:

build:
permissions:
contents: write # to write documentation files to the repo
contents: write # to write documentation files to the repo

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Checkout source
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with:
node-version: 18
registry-url: https://registry.npmjs.org/

- name: Install dependencies
run: |
npm ci
npm i jsdoc
npm i clean-jsdoc-theme
- name: Generate documentation
run: |
echo "# Web5 JS SDK" > README-docs.md
Expand All @@ -55,13 +55,13 @@ jobs:
deploy:
# Add a dependency to the build job
needs: build

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
contents: read # to read from project repo
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
contents: read # to read from project repo
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
name: github-pages
Expand All @@ -85,7 +85,7 @@ jobs:
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: './docs'
path: "./docs"

- name: Deploy to GitHub Pages
id: deployment
Expand Down
28 changes: 0 additions & 28 deletions .github/workflows/npm-publish-stable.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/npm-publish-unstable.yml

This file was deleted.

46 changes: 46 additions & 0 deletions .github/workflows/release-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Release to NPM Registry

on:
release:
types: [created]

concurrency: ${{ github.workflow }}-${{ github.ref }}

permissions:
contents: read
id-token: write

jobs:
publish-npm:
name: Release NPM Package
runs-on: ubuntu-latest

steps:
- name: Checkout source
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2

- name: Set up Node.js
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with:
node-version: 18
registry-url: https://registry.npmjs.org/

- name: Install latest npm
run: npm install -g npm@latest

- name: Install dependencies
run: npm ci

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

# 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: Display the npm username of the currently logged-in user
run: npm whoami
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

- name: Publish Release to NPM Public Registry
run: npm publish --ws --access public --provenance
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
58 changes: 58 additions & 0 deletions .github/workflows/tests-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Run Tests in Node and Browsers

on:
push:
branches:
- main
pull_request:
branches:
- main

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
test-on-node:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2

- name: Set up Node.js
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with:
node-version: 18
registry-url: https://registry.npmjs.org/

- name: Install latest npm
run: npm install -g npm@latest

- name: Install dependencies
run: npm ci

- name: Run tests for all packages
run: npm run test:node --ws

test-on-browsers:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2

- name: Set up Node.js
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with:
node-version: 18
registry-url: https://registry.npmjs.org/

- name: Install latest npm
run: npm install -g npm@latest

- name: Install Playwright Browsers
run: npx playwright install --with-deps

- name: Install dependencies
run: npm ci

- name: Run tests for all packages
run: npm run test:browser --ws
Loading

0 comments on commit 71937dc

Please sign in to comment.