Skip to content

Commit

Permalink
💚 Update ci/cd workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
almond-bongbong committed Aug 26, 2023
1 parent 8249407 commit 41e0042
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 30 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/00_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: ✅ Test

on:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: yarn install

- name: Build package
run: yarn build

- name: Test package
run: yarn test

- name: Dispatch test done event
run: |
curl -X POST \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/owner/repo/dispatches \
-d '{"event_type": "test-done"}'
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: Auto Release

on:
push:
branches:
- master
repository_dispatch:
types: [test-done]

jobs:
create_release:
Expand All @@ -12,18 +11,6 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: yarn install

- name: Build package
run: yarn build

- name: Get version from package.json
id: version
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: Deploy to GitHub Pages

on:
push:
branches:
- master
repository_dispatch:
types: [test-done]

jobs:
deploy:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ name: Publish Github Package
on:
release:
types: [created]
#on:
# push:
# branches:
# - master

jobs:
build:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ name: Publish NPM Package
on:
release:
types: [created]
#on:
# push:
# branches:
# - master

jobs:
build:
Expand Down
File renamed without changes.
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@
"test:watch": "jest --watch",
"prebuild:theme": "rm -rf src/theme/theme-classnames.json",
"build:theme": "postcss src/theme/*.css -d dist/theme --env theme",
"prebuild": "npm run build:theme",
"prebuild": "yarn build:theme",
"build": "rollup -c",
"start:theme": "postcss src/theme/*.css -d dist/theme --env theme --watch",
"start": "concurrently \"rollup -c -w\" \"npm run start:theme\"",
"prepare": "npm run test",
"predeploy": "cd example && npm install && npm run build",
"start": "concurrently \"rollup -c -w\" \"yarn start:theme\"",
"predeploy": "cd example && yarn install && yarn build",
"deploy": "gh-pages -d example/build"
},
"peerDependencies": {
Expand Down

0 comments on commit 41e0042

Please sign in to comment.