-
-
Notifications
You must be signed in to change notification settings - Fork 268
58 lines (50 loc) · 1.69 KB
/
Copy pathutils-release.yml
File metadata and controls
58 lines (50 loc) · 1.69 KB
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
49
50
51
52
53
54
55
56
57
58
name: Utils Publish
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
tag:
description: "Release tag (e.g. v1.2.3)"
required: false
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
publish:
runs-on: depot-ubuntu-24.04
defaults:
run:
working-directory: ./src/typescript/utils
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://registry.npmjs.org
- name: Set version from tag
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
TAG_NAME=${{ github.event.inputs.tag }}
else
TAG_NAME=${GITHUB_REF_NAME}
fi
if [ -z "$TAG_NAME" ]; then
echo "Error: No tag specified."
exit 1
fi
npm version "$TAG_NAME" --no-git-tag-version
- name: Install API dependencies
run: npm --prefix ../api ci
- name: Build API dependency
run: npm --prefix ../api run build
- name: Install dependencies
run: npm ci
- name: Build package
run: npm run build
- uses: JS-DevTools/npm-publish@19c28f1ef146469e409470805ea4279d47c3d35c
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./src/typescript/utils