Skip to content

Commit

Permalink
Merge branch 'main' into add-lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr-Electron committed Sep 30, 2023
2 parents 1ace32a + df38c35 commit 43688cc
Show file tree
Hide file tree
Showing 3,497 changed files with 70,741 additions and 167,712 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
11 changes: 7 additions & 4 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/node_modules

# External documentation
/*/external
/docs/external

# Production
/build
Expand All @@ -16,6 +16,9 @@
/cli/test

# Ignore autogenerated API docs
/iota/develop/nodes/rest-api
/shimmer/develop/nodes/core-rest-api
/next/develop/nodes/core-rest-api
/docs/build/iota-sdk/1.0.0/docs/references
!/docs/build/iota-sdk/1.0.0/docs/references/rust-api-reference.md
!/docs/build/iota-sdk/1.0.0/docs/references/wasm-api-reference.md
/docs/build/apis
!/docs/build/apis/welcome.md
!/docs/build/apis/sidebars.ts
30 changes: 30 additions & 0 deletions .github/actions/prepare/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: prepare
description: Prepare Yarn and caches

runs:
using: 'composite'
steps:
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Allow modern Yarn
run: corepack enable
shell: bash
# Dependencies manually cached because `actions/setup-node@v3` does not support corepack
- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
.yarn/cache
key: wiki-dependencies-${{ hashFiles('yarn.lock') }}
restore-keys: |
wiki-dependencies
- name: Install dependencies
run: yarn
shell: bash
# Artifacts cached after install to prevent removal by Yarn
- name: Cache build artifacts
uses: actions/cache@v3
with:
path: node_modules/.cache
key: wiki-build-artifacts
80 changes: 0 additions & 80 deletions .github/workflows/build.reusable.yaml

This file was deleted.

46 changes: 46 additions & 0 deletions .github/workflows/clear.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: clear

on:
workflow_dispatch:
issue_comment:
types: [created]

concurrency:
group: ${{ github.workflow }}-${{ github.event.issue.number || github.ref }}
cancel-in-progress: true

jobs:
clear:
if: |
github.event_name == 'workflow_dispatch' ||
(
github.event.issue.pull_request &&
contains(github.event.comment.body, '/clear-build')
)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.issue.pull_request && format('refs/pull/{0}/merge', github.event.issue.number) || '' }}
- name: Prepare Yarn
uses: ./.github/actions/prepare/
- name: Clear Docusaurus build cache
run: yarn clear
- name: Prepare build
run: yarn prepare
shell: bash
- name: Build
run: yarn build
# Create a comment on the pull request that the clear build completed
- name: Comment on pull request
if: github.event_name != 'workflow_dispatch'
uses: actions/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `Clear build has completed and caches have been renewed.`
})
13 changes: 0 additions & 13 deletions .github/workflows/config.reusable.yaml

This file was deleted.

42 changes: 16 additions & 26 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,33 @@
name: deploy

env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}

on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'

jobs:
build:
strategy:
matrix:
environment: [iota, shimmer, next]
uses: ./.github/workflows/build.reusable.yaml
with:
environment: ${{ matrix.environment }}
ref: ''
config:
uses: ./.github/workflows/config.reusable.yaml
deploy:
runs-on: ubuntu-latest
needs:
- build
- config
env:
MODE: production
steps:
- uses: actions/setup-node@v3
- uses: actions/checkout@v3
with:
node-version: 16
# All previous jobs upload to same artifact so only a single download required
- name: Download build
uses: actions/download-artifact@v3
with:
name: build
# Paths of the build artifacts are preserved (`build`, `build/shimmer`, and `build/next`)
- name: Extract build
run: |
tar -xf iota.tar
tar -xf shimmer.tar
tar -xf next.tar
# Needed for showLastUpdateTime to work
fetch-depth: 0
- name: Prepare Yarn
uses: ./.github/actions/prepare/
- name: Prepare build
run: yarn prepare
shell: bash
- name: Checkout remote
run: yarn checkout:remote
- name: Build
run: yarn build
# Convert to Vercel project and upload
- name: Install Vercel CLI
run: npm install --global vercel@latest
Expand Down
44 changes: 16 additions & 28 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: preview

env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}

on:
workflow_dispatch:
pull_request:
Expand All @@ -10,8 +12,12 @@ on:
issue_comment:
types: [created]

concurrency:
group: ${{ github.workflow }}-${{ github.event.issue.number || github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
preview:
if: |
github.event_name == 'workflow_dispatch' ||
(
Expand All @@ -24,36 +30,18 @@ jobs:
)
)
)
strategy:
matrix:
environment: [iota, shimmer, next]
uses: ./.github/workflows/build.reusable.yaml
with:
ref: ${{ github.event.issue.pull_request && format('refs/pull/{0}/merge', github.event.issue.number) || '' }}
environment: ${{ matrix.environment }}
config:
needs: [build]
uses: ./.github/workflows/config.reusable.yaml
deploy:
runs-on: ubuntu-latest
needs:
- build
- config
steps:
- uses: actions/setup-node@v3
with:
node-version: 16
# All previous jobs upload to same artifact so only a single download required
- name: Download build
uses: actions/download-artifact@v3
- uses: actions/checkout@v3
with:
name: build
# Paths of the build artifacts are preserved (`build`, `build/shimmer`, and `build/next`)
- name: Extract build
run: |
tar -xf iota.tar
tar -xf shimmer.tar
tar -xf next.tar
ref: ${{ github.event.issue.pull_request && format('refs/pull/{0}/merge', github.event.issue.number) || '' }}
- name: Prepare Yarn
uses: ./.github/actions/prepare/
- name: Prepare build
run: yarn prepare
shell: bash
- name: Build
run: yarn build
# Convert to Vercel project and upload
- name: Install Vercel CLI
run: npm install --global vercel@latest
Expand Down
35 changes: 9 additions & 26 deletions .github/workflows/publish.reusable.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: publish package

on:
workflow_call:
inputs:
Expand All @@ -10,6 +11,7 @@ on:
description: 'Workspace name'
required: true
type: string

jobs:
check:
# TODO: Output `changed: true` only when version is higher than previous, not just changed
Expand Down Expand Up @@ -42,46 +44,27 @@ jobs:
if: needs.check.outputs.changed != 'true'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'
- name: Allow modern Yarn
run: |
corepack enable
- name: Install dependencies
run: |
yarn
- name: Prepare Yarn
uses: ./.github/actions/prepare/
# Test if packaging will succeed
- name: Pack
run: |
yarn workspace ${{ inputs.workspace }} pack --dry-run
run: yarn workspace ${{ inputs.workspace }} pack --dry-run
publish:
runs-on: ubuntu-latest
needs:
- check
if: needs.check.outputs.changed == 'true'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'
- name: Allow modern Yarn
run: |
corepack enable
- name: Install dependencies
run: |
yarn
- name: Prepare Yarn
uses: ./.github/actions/prepare/
- name: Publish to NPM
run: |
yarn workspace ${{ inputs.workspace }} npm publish --access public --tag experimental
run: yarn workspace ${{ inputs.workspace }} npm publish --access public --tag experimental
env:
YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
YARN_NPM_REGISTRY_SERVER: 'https://registry.npmjs.org'
- name: Publish to GitHub
run: |
yarn workspace ${{ inputs.workspace }} npm publish --access public --tag experimental
run: yarn workspace ${{ inputs.workspace }} npm publish --access public --tag experimental
env:
YARN_NPM_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
YARN_NPM_REGISTRY_SERVER: 'https://npm.pkg.github.com'
Loading

0 comments on commit 43688cc

Please sign in to comment.