Skip to content

Commit

Permalink
chore(semantic-release): local sr + simplified workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
abernier committed Jun 29, 2023
1 parent 290272d commit f35d582
Show file tree
Hide file tree
Showing 4 changed files with 2,351 additions and 112 deletions.
46 changes: 7 additions & 39 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: release
on:
push:
branches:
- 'master'
- 'beta'
- 'alpha'
push: {}
pull_request: {}

# Cancel any previous run (see: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency)
Expand All @@ -16,42 +12,14 @@ jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: 'yarn'
- name: Install deps
# this runs a build script so there is no dedicated build
run: yarn install
- name: Run storybook build script
run: yarn build-storybook
release:
needs: main
runs-on: ubuntu-latest
if: ${{ github.repository == 'pmndrs/drei' && contains('refs/heads/master,refs/heads/beta,refs/heads/alpha',github.ref) && github.event_name == 'push' }}
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
cache: 'yarn'
- name: Install deps
# this runs a build script so there is no dedicated build
run: yarn install
- name: 🚀 Release
uses: cycjimmy/semantic-release-action@v3
with:
extra_plugins: |
@semantic-release/git
branches: |
[
'master',
{name: 'beta', prerelease: true},
{name: 'alpha', prerelease: true}
]
- run: yarn install
- run: yarn build-storybook
# semantic-release skips not configured branches(see: release.config.js) or pull-requests
- run: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
"typegen": "tsc --emitDeclarationOnly",
"storybook": "NODE_OPTIONS=\"--openssl-legacy-provider\" storybook dev -p 6006",
"build-storybook": "NODE_OPTIONS=\"--openssl-legacy-provider\" storybook build",
"copy": "copyfiles package.json README.md LICENSE dist && json -I -f dist/package.json -e \"this.private=false; this.devDependencies=undefined; this.optionalDependencies=undefined; this.scripts=undefined; this.husky=undefined; this.prettier=undefined; this.jest=undefined; this['lint-staged']=undefined;\""
"copy": "copyfiles package.json README.md LICENSE dist && json -I -f dist/package.json -e \"this.private=false; this.devDependencies=undefined; this.optionalDependencies=undefined; this.scripts=undefined; this.husky=undefined; this.prettier=undefined; this.jest=undefined; this['lint-staged']=undefined;\"",
"release": "semantic-release"
},
"dependencies": {
"@babel/runtime": "^7.11.2",
Expand Down Expand Up @@ -129,6 +130,7 @@
"rollup": "^3.25.1",
"rollup-plugin-glslify": "^1.3.0",
"rollup-plugin-multi-input": "^1.4.1",
"semantic-release": "^21.0.6",
"storybook": "^7.0.12",
"three": "^0.149.0",
"ts-node": "^10.9.1",
Expand Down
8 changes: 1 addition & 7 deletions release.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module.exports = {
branches: ['master', { name: 'alpha', prerelease: true }, { name: 'beta', prerelease: true }],
plugins: [
'@semantic-release/commit-analyzer',
'@semantic-release/release-notes-generator',
Expand All @@ -9,12 +10,5 @@ module.exports = {
},
],
'@semantic-release/github',
[
'@semantic-release/git',
{
assets: ['package.json'],
message: 'chore(release): ${nextRelease.version}',
},
],
],
}
Loading

0 comments on commit f35d582

Please sign in to comment.