-
Notifications
You must be signed in to change notification settings - Fork 12
44 lines (41 loc) · 1.51 KB
/
release-alpha.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
name: Release alpha version
on:
workflow_dispatch:
inputs:
manualPackageVersion:
type: string
required: false
description: 'If your build failed and the version is already exists you can set version of package manually, e.g. 3.0.0-alpha.0. Use the prefix `alpha` otherwise you will get error.'
jobs:
build:
runs-on: ubuntu-latest
steps:
- run: |
if [ "${{ github.event.inputs.manualPackageVersion }}" != "" ]; then
if [[ "${{ github.event.inputs.manualPackageVersion }}" != *"alpha"* ]]; then
echo "manualPackageVersion set incorrectly! Check that is contains alpha in it's name"
exit 1
fi
fi
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
- run: npm ci
shell: bash
- run: npm test
shell: bash
- name: Bump and commit version
run: |
echo ${{ github.event.inputs.manualPackageVersion }}
if [ "${{ github.event.inputs.manualPackageVersion }}" == "" ]; then
npm version prerelease --preid=alpha --git-tag-version=false
else
npm version ${{ github.event.inputs.manualPackageVersion }} --git-tag-version=false
fi
- name: Publish version
run: npm publish --tag alpha --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.GRAVITY_UI_BOT_NPM_TOKEN }}
shell: bash