-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (32 loc) · 1017 Bytes
/
dev-github-packages.yml
File metadata and controls
38 lines (32 loc) · 1017 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Publish Package to GitHub Packages (preview)
on:
push:
branches:
- alpha
- next
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18.x'
registry-url: 'https://npm.pkg.github.com'
scope: '@webresto'
- run: npm install 2>&1 || true && TZ=GMT-3 npm run test
- run: npm run build
- name: Publish preview to GitHub Packages
working-directory: ./dist
run: |
set -euo pipefail
BRANCH=${GITHUB_REF_NAME}
BASE_VERSION=$(node -p "require('./package.json').version.split('-')[0]")
npm version "${BASE_VERSION}-${BRANCH}.${GITHUB_RUN_NUMBER}" --no-git-tag-version
rm -f .npmrc
npm publish --tag "$BRANCH" --registry=https://npm.pkg.github.com
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}