From 48732896a662ff8b50bb4a5d263b0c78061049b5 Mon Sep 17 00:00:00 2001 From: Juli Ovechkina Date: Mon, 18 Sep 2023 17:41:40 +0100 Subject: [PATCH] ci: use release-actions for alpha --- .github/workflows/release-alpha.yml | 37 +++++++---------------------- 1 file changed, 9 insertions(+), 28 deletions(-) diff --git a/.github/workflows/release-alpha.yml b/.github/workflows/release-alpha.yml index 6b52c1ede..314d014fb 100644 --- a/.github/workflows/release-alpha.yml +++ b/.github/workflows/release-alpha.yml @@ -9,36 +9,17 @@ on: 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: + 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 + echo ${{ github.event.inputs.manualPackageVersion }} + - uses: gravity-ui/release-action@yuberdysheva/alpha-release 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 + default-branch: alpha + manual-version: ${{ github.event.inputs.manualPackageVersion }} + prerelease: true