Skip to content

Commit

Permalink
chore(semantic-release): local sr + simplified workflow (#1545)
Browse files Browse the repository at this point in the history
  • Loading branch information
abernier committed Jul 2, 2023
1 parent 807d530 commit 2fedb36
Show file tree
Hide file tree
Showing 4 changed files with 2,350 additions and 107 deletions.
40 changes: 6 additions & 34 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,42 +16,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

1 comment on commit 2fedb36

@vercel
Copy link

@vercel vercel bot commented on 2fedb36 Jul 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.