Skip to content
Draft
Show file tree
Hide file tree
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
57 changes: 0 additions & 57 deletions .github/workflows/devworkspace-generator-publish-next.yml

This file was deleted.

78 changes: 0 additions & 78 deletions .github/workflows/devworkspace-generator-release.yml

This file was deleted.

101 changes: 101 additions & 0 deletions .github/workflows/typescript-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
#
# Copyright (c) 2022-2024
# 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
#

# Main workflow for building and publishing release builds
# Release commit
name: Publish project to npmjs

on:
workflow_dispatch:
inputs:
release-version:
description: 'release version in format 7.y.z'
required: true
release-remake:
description: 'set to true to recreate existing tags (otherwise release will fail if tags already exist)'
type: boolean
default: false
required: true
push:
branches:
- main
- 7.**.x

permissions:
id-token: write # Required for publishing to npmjs
contents: write
pull-requests: write

jobs:
publish:
name: Build and publish DevWorkspace Generator to npmjs
runs-on: ubuntu-22.04
steps:
- name: Validate parameters and build type
shell: bash
run: |
# check if workflow is triggered manually (release) or via branch push (next build)
if [[ "$GITHUB_EVENT_NAME" == "workflow_dispatch" ]]; then
RELEASE_VERSION=${{ github.event.inputs.release-version }}
if [[ "$RELEASE_VERSION" =~ "^[0-9]+\.[0-9]+\.[0-9]+$" ]]; then
echo "[INFO]" preparing to build and release with version: $RELEASE_VERSION
DIST_TAG=$RELEASE_VERSION
else
echo "[ERROR]" incorrect version "$RELEASE_VERSION". Must be following format <number>.<number>.<number>, e.g. 7.111.0
exit 1
fi
fi
if [[ "$GITHUB_EVENT_NAME" == "push" ]]; then
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
fi
echo "npm_dist_tag=$DIST_TAG" >> $GITHUB_OUTPUT
- uses: actions/setup-node@v4
with:
node-version: '24'
registry-url: 'https://registry.npmjs.org'
scope: '@eclipse-che'
- name: "Checkout source code"
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up environment
run: |
sudo apt-get update -y || true
sudo apt-get -y -q install hub
hub --version
- 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
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: yarn-${{ hashFiles('yarn.lock') }}
restore-keys: yarn-
- name: Perform release
if: github.event_name == 'workflow_dispatch'
run: |
./make-release.sh --version ${{ github.event.inputs.release-version }}
- name: Update build version
if: github.event_name == 'push'
run: |
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

Loading