Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

chore: release: bump to 7.88.0-next in main (#826) #57

chore: release: bump to 7.88.0-next in main (#826)

chore: release: bump to 7.88.0-next in main (#826) #57

#
# Copyright (c) 2022 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
name: devworkspace-generator-publish-next
on:
push:
branches:
- main
- 7.**.x
paths:
- 'tools/devworkspace-generator/**'
- '.github/workflows/devworkspace-generator-publish-next.yml'
jobs:
publish:
runs-on: ubuntu-22.04
steps:
- uses: actions/setup-node@v4
with:
node-version: '16'
registry-url: 'https://registry.npmjs.org'
scope: '@eclipse-che'
- name: Clone source code
uses: actions/checkout@v4
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: yarn-${{ hashFiles('tools/devworkspace-generator/yarn.lock') }}
restore-keys: yarn-
- name: publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
run: |
if [[ ${GITHUB_REF##*/} == "7."**".x" ]]; then
echo "[INFO] using ${GITHUB_REF##*/} tag"
DIST_TAG="next-${GITHUB_REF##*/}"
else
echo "[INFO] using "next" tag"
DIST_TAG=next
fi
cd tools/devworkspace-generator
yarn
yarn compile
SHORT_SHA1=$(git rev-parse --short=7 HEAD)
CURRENT_VERSION=$(jq -r '.version' package.json)
NEW_VERSION="${CURRENT_VERSION}-${SHORT_SHA1}"
echo New version is ${NEW_VERSION}
sed -i -r -e "s/(\"version\": )(\".*\")/\1\"$NEW_VERSION\"/" package.json
npm publish --tag $DIST_TAG