-
Notifications
You must be signed in to change notification settings - Fork 2
48 lines (44 loc) · 1.28 KB
/
devel.yml
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
39
40
41
42
43
44
45
46
47
48
name: Publish devel version
on:
workflow_run:
workflows:
- Unit Test
types:
- completed
branches:
- main
jobs:
publish_npm:
if: github.ref == 'refs/heads/main' && github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Install
run: |
npm install -g npm@latest
npm install
- name: Build
run: |
npm run build
- name: Publish
run: |
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
npm run publish:devel
env:
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
- name: Add tag
uses: actions/github-script@v7
with:
script: |
const readFileSync = require('fs').readFileSync;
const join = require('path').join;
const packageJson = JSON.parse(readFileSync(join('packages', 'types', 'package.json'), 'utf8'));
const version = packageJson.version;
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/v' + version,
sha: context.sha
})