Skip to content

Commit b4750f8

Browse files
author
Juli Ovechkina
authored
ci: alpha releases with release-actions (#616)
1 parent 9773738 commit b4750f8

File tree

1 file changed

+17
-30
lines changed

1 file changed

+17
-30
lines changed

.github/workflows/release-alpha.yml

Lines changed: 17 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,29 @@ name: Release alpha version
33
on:
44
workflow_dispatch:
55
inputs:
6-
manualPackageVersion:
6+
manualVersion:
77
type: string
88
required: false
99
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.'
10+
prerelease:
11+
type: choice
12+
description: Release type, patch is used by default
13+
default: 'prerelease'
14+
options:
15+
- prerelease
16+
- prepatch
17+
- preminor
18+
- premajor
1019

1120
jobs:
12-
build:
21+
release:
1322
runs-on: ubuntu-latest
1423
steps:
15-
- run: |
16-
if [ "${{ github.event.inputs.manualPackageVersion }}" != "" ]; then
17-
if [[ "${{ github.event.inputs.manualPackageVersion }}" != *"alpha"* ]]; then
18-
echo "manualPackageVersion set incorrectly! Check that is contains alpha in it's name"
19-
exit 1
20-
fi
21-
fi
22-
- uses: actions/checkout@v2
23-
- uses: actions/setup-node@v1
24+
- uses: gravity-ui/release-action@v1
2425
with:
26+
github-token: ${{ secrets.GRAVITY_UI_BOT_GITHUB_TOKEN }}
27+
npm-token: ${{ secrets.GRAVITY_UI_BOT_NPM_TOKEN }}
2528
node-version: 18
26-
registry-url: 'https://registry.npmjs.org'
27-
- run: npm ci
28-
shell: bash
29-
- run: npm test
30-
shell: bash
31-
- name: Bump and commit version
32-
run: |
33-
echo ${{ github.event.inputs.manualPackageVersion }}
34-
35-
if [ "${{ github.event.inputs.manualPackageVersion }}" == "" ]; then
36-
npm version prerelease --preid=alpha --git-tag-version=false
37-
else
38-
npm version ${{ github.event.inputs.manualPackageVersion }} --git-tag-version=false
39-
fi
40-
- name: Publish version
41-
run: npm publish --tag alpha --access public
42-
env:
43-
NODE_AUTH_TOKEN: ${{ secrets.GRAVITY_UI_BOT_NPM_TOKEN }}
44-
shell: bash
29+
npm-dist-tag: alpha
30+
npm-preid: alpha
31+
npm-version: ${{ github.event.inputs.manualVersion || github.event.inputs.prerelease }}

0 commit comments

Comments
 (0)