Skip to content

Commit

Permalink
add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Sysix committed Jun 16, 2024
1 parent a0a10d3 commit 4eefc94
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release to npmjs
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest

permissions:
contents: read
id-token: write

steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'

- name: install npm globally
run: npm install -g npm

- name: install package
run: npm ci

- name: bump version
run: |
npm version ${{ github.ref_name }}
git config --global user.name '${{ github.repository_owner }}'
git config --global user.email '${{ github.repository_owner }}@users.noreply.github.com'
git commit -am "bump version to ${{ github.ref_name }}"
- name: release
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
"module": "dist/index.js",
"browser": "dist/index.js",
"types": "types/index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/Sysix/broadcast-single-worker.git"
},
"exports": {
"./package.json": "./package.json",
".": {
Expand Down

0 comments on commit 4eefc94

Please sign in to comment.