-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (44 loc) · 1.35 KB
/
release-sdk.yaml
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
name: Release SDK to NPM
on:
workflow_dispatch:
inputs:
channel:
type: choice
description: |
Choose the release channel/tag.
Make sure to update the version in package.json before publishing.
options:
- beta
- production
default: 'beta'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install pnpm
run: npm install -g pnpm
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
version="$(pnpm pkg get version --workspace='@expediagroup/lodging-connectivity-sdk' | sed -n 's/.*"\(.*\)".*/\1/p')"
echo "Current version: version"
if [ "${{ inputs.channel }}" == "production" ]; then
echo "Publishing a production release: $curr_version"
npm i
npx tsc
npm publish
elif [ "${{ inputs.channel }}" == "beta" ]; then
echo "Publishing a beta release: $version"
npm version "$version" --allow-same-version
npm i
npx tsc
npm publish --tag beta
fi