Skip to content

Commit

Permalink
[INF-674] Add changesets (#8036)
Browse files Browse the repository at this point in the history
  • Loading branch information
sliptype authored Apr 16, 2024
1 parent 5e1ceb4 commit aae5184
Show file tree
Hide file tree
Showing 42 changed files with 5,333 additions and 7,111 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
3 changes: 2 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ jobs:
- ./packages/identity-service/node_modules
- ./packages/es-indexer/node_modules
- ./packages/ddex/node_modules
- ./packages/ddex/webapp/node_modules
- ./packages/ddex/webapp/client/node_modules
- ./packages/ddex/webapp/server/node_modules
- ./packages/ddex/publisher/node_modules
- ./packages/trpc-server/node_modules
- ./packages/create-audius-app/node_modules
Expand Down
4 changes: 2 additions & 2 deletions .circleci/src/jobs/@ddex-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ ddex-webapp-init:
root: ./
paths:
- node_modules
- packages/ddex/node_modules
- packages/ddex/webapp/node_modules
- packages/ddex/webapp/client/node_modules
- packages/ddex/webapp/server/node_modules

ddex-publisher-init:
working_directory: ~/audius-protocol
Expand Down
21 changes: 17 additions & 4 deletions .circleci/src/jobs/@harmony-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ harmony-init:
- run:
name: lint
command: |
cd packages/harmony
npm run lint
npx turbo run lint --filter=@audius/harmony
# Persist node modules directory to workspace
- persist_to_workspace:
Expand All @@ -37,13 +36,27 @@ harmony-build-storybook:
- run:
name: build storybook
command: |
cd packages/harmony
npm run build-storybook
npx turbo run build-storybook --filter=@audius/harmony
- persist_to_workspace:
root: ./
paths:
- packages/harmony/storybook-static

harmony-test-storybook:
working_directory: ~/harmony
docker:
- image: cimg/node:18.17
steps:
- checkout
- attach_workspace:
at: ./
- run:
name: test storybook
command: |
sudo npx playwright install-deps
npx playwright install
npx turbo run test --filter=@audius/harmony
harmony-deploy-storybook:
working_directory: ~/harmony
docker:
Expand Down
14 changes: 10 additions & 4 deletions .circleci/src/workflows/harmony.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
when: << pipeline.parameters.run-harmony-workflow >>
jobs:
- harmony-init
- harmony-init:
context:
- Vercel
- harmony-build-storybook:
context:
- Vercel
requires:
- harmony-init
filters:
branches:
only: /^main$/
# - harmony-test-storybook:
# context:
# - Vercel
# requires:
# - harmony-build-storybook
- harmony-deploy-storybook:
context: Audius Client
requires:
Expand Down
69 changes: 69 additions & 0 deletions .github/workflows/publish-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Publish Packages

on:
push:
branches:
- main

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

jobs:
changes:
name: Check for changes to public packages
runs-on: ubuntu-latest
outputs:
public-packages: ${{ steps.filter.outputs.public-packages }}
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
public-packages:
- 'packages/create-audius-app/**'
- 'packages/fixed-decimal/**'
- 'packages/harmony/**'
- 'packages/libs/**'
- 'packages/spl/**'
publish-packages:
name: Publish Packages to NPM
needs: changes
if: ${{ needs.changes.outputs.public-packages == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
cache-dependency-path: |
package-lock.json
packages/*/patches/*.patch
- uses: actions/cache@v3
with:
path: '~/.npm'
key: ${{ runner.os }}-${{ matrix.node-version }}-npmcache-${{ hashFiles('package-lock.json') }}-${{ hashFiles('packages/*/patches/*.patch') }}

- name: Update .npmrc
run: |
cat << EOF > "$HOME/.npmrc"
//registry.npmjs.org/:_authToken=$NPM_TOKEN
EOF
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: bash ./scripts/publish-packages.sh
version: bash ./scripts/version-packages.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CI: true
2 changes: 1 addition & 1 deletion .hooks/pre-commit.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"steps": [
{
"name": "check secrets",
"command": "npm run check-secrets"
"command": "[[ -n $CI ]] || npm run check-secrets"
}
]
}
Expand Down
Loading

0 comments on commit aae5184

Please sign in to comment.