Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: alpha releases with release-actions #616

Merged
merged 6 commits into from
Oct 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 17 additions & 30 deletions .github/workflows/release-alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,29 @@ name: Release alpha version
on:
workflow_dispatch:
inputs:
manualPackageVersion:
manualVersion:
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.'
prerelease:
type: choice
description: Release type, patch is used by default
default: 'prerelease'
options:
- prerelease
- prepatch
- preminor
- premajor

jobs:
build:
release:
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
- uses: gravity-ui/release-action@v1
with:
github-token: ${{ secrets.GRAVITY_UI_BOT_GITHUB_TOKEN }}
npm-token: ${{ secrets.GRAVITY_UI_BOT_NPM_TOKEN }}
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
npm-dist-tag: alpha
npm-preid: alpha
npm-version: ${{ github.event.inputs.manualVersion || github.event.inputs.prerelease }}
Loading