ci: add release.yml

This commit is contained in:
himself65 2023-04-20 17:45:45 -05:00
parent c4e90f2d8b
commit e399682cad
4 changed files with 39 additions and 1 deletions

19
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,19 @@
name: Release
on:
push:
tags:
- 'v*'
jobs:
release:
name: Publish npm release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Try publishing to NPM
run: ./scripts/publish.sh
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

View File

@ -2,7 +2,7 @@ nmMode: hardlinks-local
nodeLinker: node-modules
npmAuthToken: '${NODE_AUTH_TOKEN:-NONE}'
npmAuthToken: '${NPM_TOKEN:-NONE}'
npmPublishAccess: public

View File

@ -12,6 +12,7 @@
".": "./src/index.ts"
},
"publishConfig": {
"access": "public",
"main": "dist/index.umd.cjs",
"module": "dist/index.js",
"exports": {

18
scripts/publish.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/bash
packages=(
"y-indexeddb"
)
for package in "${packages[@]}"; do
cd "packages/$package"
yarn build
if [ "$NIGHTLY" = "true" ]; then
yarn npm publish --no-git-checks --tag nightly
else
yarn npm publish
fi
cd ../../
done