Skip to content

Commit

Permalink
Merge pull request #3 from daphnesmit/develop
Browse files Browse the repository at this point in the history
ci: add semantic release
  • Loading branch information
daphnesmit authored Mar 28, 2024
2 parents cd8b960 + c1cf5a7 commit ff409df
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 19 deletions.
28 changes: 13 additions & 15 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: Publish

on:
workflow_dispatch:
release:
types: [published]
workflow_run:
workflows: ['Main']
types:
- completed
branches:
- main
- develop

permissions:
contents: read
Expand All @@ -25,17 +26,14 @@ jobs:
- name: Deploy Storybook
uses: bitovi/github-actions-storybook-to-github-pages@v1.0.2
with:
install_command: npm install --frozen-lockfile
install_command: npm ci
build_command: npm build-storybook
path: storybook-static
env:
GH_TOKEN: ${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}

# - name: Build and publish to npm
# if: github.ref == 'refs/tags/v*' # Only run on version tags
# run: |
# npm build
# npm login --registry=https://registry.npmjs.org/ --scope=your-scope
# npm publish
# env:
# NODE_AUTH_TOKEN: ${{ secrets.YOUR_NPM_AUTH_TOKEN }}
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
15 changes: 15 additions & 0 deletions .releaserc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
branches: [
'main',
{
name: 'develop',
prerelease: true,
},
],
plugins: [
'@semantic-release/npm',
'@semantic-release/github',
'@semantic-release/commit-analyzer',
'@semantic-release/release-notes-generator',
],
};
14 changes: 10 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@
"name": "@daphnesmit/use-websocket",
"description": "React hook and provider to integrate WebSockets into your React Components",
"version": "0.0.0",
"author": "",
"license": "",
"keywords": [],
"author": "Daphne Smit",
"license": "MIT",
"keywords": [
"react",
"websocket",
"use-websocket",
"react-hook",
"react-provider"
],
"repository": {
"type": "git",
"url": ""
"url": "https://github.com/daphnesmit/use-websocket.git"
},
"scripts": {
"dev": "concurrently \"npm run build --watch\" \"npm run storybook\" \"npm run test\" ",
Expand Down

0 comments on commit ff409df

Please sign in to comment.