Skip to content

Commit

Permalink
ci: set up GitHub actions to deploy on tag (#40)
Browse files Browse the repository at this point in the history
closes #39

This PR also introduces a new `publish.sh` script to auto-bump & then
tag the repo.
  • Loading branch information
joduplessis authored Jan 31, 2024
1 parent 2017b08 commit c9f6d69
Show file tree
Hide file tree
Showing 9 changed files with 88 additions and 1,024 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Pull request workflow

on:
pull_request:
branches:
- '**'

jobs:
test_pull_request:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: "18"
- name: Install dependencies
run: npm install
- name: Build @fold-dev/design
run: npm --workspace @fold-dev/design run build:prod
- name: Build @fold-dev/core
run: npm --workspace @fold-dev/core run build:prod
- name: Run tests
run: npm test
25 changes: 25 additions & 0 deletions .github/workflows/tag-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Tag publish workflow

on:
push:
tags:
- 'v*'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: "18"

- name: Publish to NPM
working-directory: ./
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npm install
npm run publish
18 changes: 7 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,9 @@
},
"scripts": {
"prepare": "husky install",
"dev:design": "npm --workspace @fold-dev/core run watch:styles | npm --workspace @fold-dev/core run watch | npm run storybook | npm --workspace @fold-dev/design run watch",
"dev": "npm --workspace @fold-dev/core run watch:styles | npm --workspace @fold-dev/core run watch | npm run storybook",
"dev": "npm --workspace @fold-dev/core run watch:styles | npm --workspace @fold-dev/core run watch | npm run storybook | npm --workspace @fold-dev/design run watch",
"storybook": "storybook dev -p 6006",
"storybook:build": "npm --workspace @fold-dev/core run build:prod && storybook build -c .storybook -o storybook-static",
"build:storybook:docs": "npm --workspace @fold-dev/core run build:styles && npm --workspace @fold-dev/core run build && npm run storybook:build",
"build:storybook": "npm --workspace @fold-dev/core run build:styles && storybook build",
"storybook:build": "npm --workspace @fold-dev/design run build:prod && npm --workspace @fold-dev/core run build:prod && storybook build -c .storybook -o storybook-static",
"build:docs": "ts-node ./scripts/docgen/build.ts",
"build:typedoc": "typedoc --options ./typedoc.json",
"build:typedoc:md": "typedoc --plugin typedoc-plugin-markdown",
Expand All @@ -67,12 +64,11 @@
"lint:fix": "eslint --fix 'scripts/**/*.{ts,tsx}' 'packages/core/src/**/*.{ts,tsx}'",
"lint:watch": "eslint --watch 'scripts/**/*.{ts,tsx}' 'packages/core/src/**/*.{ts,tsx}'",
"test": "jest --config=jest.config.js --no-cache",
"publish:core:patch": "./scripts/publish.sh core patch",
"publish:core:minor": "./scripts/publish.sh core minor",
"publish:core:major": "./scripts/publish.sh core major",
"publish:design:patch": "./scripts/publish.sh design patch",
"publish:design:minor": "./scripts/publish.sh design minor",
"publish:design:major": "./scripts/publish.sh design major"
"publish:patch": "./scripts/publish.sh patch",
"publish:minor": "./scripts/publish.sh minor",
"publish:major": "./scripts/publish.sh major",
"publish": "npm --workspace @fold-dev/design run build:prod && npm --workspace @fold-dev/core run build:prod && npm --workspace @fold-dev/core publish && npm --workspace @fold-dev/design publish",
"publish:dry-run": "npm --workspace @fold-dev/design run build:prod && npm --workspace @fold-dev/core run build:prod && npm --workspace @fold-dev/core publish --dry-run && npm --workspace @fold-dev/design publish --dry-run"
},
"repository": {
"type": "git",
Expand Down
1 change: 1 addition & 0 deletions packages/design/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*

tokens*.*
38 changes: 0 additions & 38 deletions packages/design/tokens-dark.css

This file was deleted.

38 changes: 0 additions & 38 deletions packages/design/tokens-light.css

This file was deleted.

Loading

0 comments on commit c9f6d69

Please sign in to comment.