Skip to content

Commit 20745a9

Browse files
committed
chore: add github action to release beta versions
1 parent 3cdc5e7 commit 20745a9

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

.github/workflows/release-beta.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Build and publish -beta tag for @gravity-ui/date-components
2+
# Runs manually in Actions tabs in github
3+
# Runs on any branch except main
4+
5+
name: Release beta version
6+
7+
on:
8+
workflow_dispatch:
9+
inputs:
10+
version:
11+
type: string
12+
required: false
13+
description: 'If your build failed and the version is already exists you can set version of package manually, e.g. 3.0.0-beta.0. Use the prefix `beta` otherwise you will get error.'
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- run: |
20+
if [ "${{ github.event.inputs.version }}" != "" ]; then
21+
if [[ "${{ github.event.inputs.version }}" != *"beta"* ]]; then
22+
echo "version set incorrectly! Check that is contains beta in it's name"
23+
exit 1
24+
fi
25+
fi
26+
- uses: actions/checkout@v4
27+
- uses: actions/setup-node@v4
28+
with:
29+
node-version: 18
30+
registry-url: 'https://registry.npmjs.org'
31+
- name: Install Packages
32+
run: npm ci
33+
- name: Lint Files
34+
run: npm run lint
35+
- name: Typecheck
36+
run: npm run typecheck
37+
- name: Test
38+
run: npm test
39+
- name: Bump and commit version
40+
run: |
41+
echo ${{ github.event.inputs.version }}
42+
43+
if [ "${{ github.event.inputs.version }}" == "" ]; then
44+
npm version prerelease --preid=beta --git-tag-version=false
45+
else
46+
npm version ${{ github.event.inputs.version }} --git-tag-version=false
47+
fi
48+
- name: Publish version
49+
run: npm publish --tag beta --access public
50+
env:
51+
NODE_AUTH_TOKEN: ${{ secrets.GRAVITY_UI_BOT_NPM_TOKEN }}
52+
shell: bash

0 commit comments

Comments
 (0)