mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
AAE-12123 TAG_NPM fix
This commit is contained in:
parent
a412b45300
commit
6138c16f42
17
.github/actions/npm-check-bundle/action.yml
vendored
17
.github/actions/npm-check-bundle/action.yml
vendored
@ -1,19 +1,28 @@
|
|||||||
name: 'Check NPM bundle'
|
name: 'Check NPM bundle'
|
||||||
description: 'check npm bundle'
|
description: 'check npm bundle'
|
||||||
|
|
||||||
outputs:
|
inputs:
|
||||||
tag_sha:
|
branch_name:
|
||||||
description: "long sha of the tag"
|
description: "override GITHUB_REF_NAME"
|
||||||
value: ${{ steps.sha_out.outputs.tag_sha }}
|
required: false
|
||||||
|
default: $GITHUB_REF_NAME
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: load "TRAVIS_EVENT_TYPE"
|
||||||
|
uses: ./.github/actions/travis-env-var-facade
|
||||||
|
with:
|
||||||
|
branch_name: ${{ inputs.branch_name }}
|
||||||
- name: check npm bundle
|
- name: check npm bundle
|
||||||
shell: bash
|
shell: bash
|
||||||
id: sha_out
|
id: sha_out
|
||||||
run: |
|
run: |
|
||||||
|
if [[ -z $TAG_NPM ]]; then
|
||||||
|
echo "TAG_NPM not set, aborting"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
ADF_VERSION=$(npm view @alfresco/adf-core@${TAG_NPM} version)
|
ADF_VERSION=$(npm view @alfresco/adf-core@${TAG_NPM} version)
|
||||||
echo "check bundle on TAG_NPM='${TAG_NPM}' and ADF_VERSION='${ADF_VERSION}'"
|
echo "check bundle on TAG_NPM='${TAG_NPM}' and ADF_VERSION='${ADF_VERSION}'"
|
||||||
./scripts/travis/build/npm-check-bundles.sh -v ${ADF_VERSION}
|
./scripts/travis/build/npm-check-bundles.sh -v ${ADF_VERSION}
|
36
.github/actions/travis-env-var-facade/action.yml
vendored
36
.github/actions/travis-env-var-facade/action.yml
vendored
@ -7,12 +7,18 @@ inputs:
|
|||||||
description: "override github.event_name"
|
description: "override github.event_name"
|
||||||
required: false
|
required: false
|
||||||
default: ${{ github.event_name }}
|
default: ${{ github.event_name }}
|
||||||
|
branch_name:
|
||||||
|
description: "override GITHUB_REF_NAME"
|
||||||
|
required: false
|
||||||
|
default: $GITHUB_REF_NAME
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- name: Parse env global
|
- name: Parse env global
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
echo "input branch_name='${{ inputs.branch_name }}'"
|
||||||
EVENT_TYPE=""
|
EVENT_TYPE=""
|
||||||
TRAVIS_PULL_REQUEST_BRANCH=""
|
TRAVIS_PULL_REQUEST_BRANCH=""
|
||||||
TRAVIS_BRANCH=""
|
TRAVIS_BRANCH=""
|
||||||
@ -30,16 +36,26 @@ runs:
|
|||||||
elif [[ "${{ inputs.event_name }}" =~ $REGEX ]]; then
|
elif [[ "${{ inputs.event_name }}" =~ $REGEX ]]; then
|
||||||
EVENT_TYPE="api";
|
EVENT_TYPE="api";
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $GITHUB_REF_NAME == "master" ]]; then
|
|
||||||
echo "Set up TAG_NPM to latest on master branch"
|
|
||||||
TAG_NPM="latest"
|
|
||||||
fi
|
|
||||||
if [[ $GITHUB_REF_NAME == "develop" ]]; then
|
|
||||||
echo "Set up TAG_NPM to alpha on develop branch"
|
|
||||||
TAG_NPM="alpha"
|
|
||||||
fi
|
|
||||||
echo "TAG_NPM=${TAG_NPM}" >> $GITHUB_ENV
|
|
||||||
echo "TRAVIS_EVENT_TYPE=${EVENT_TYPE}" >> $GITHUB_ENV
|
echo "TRAVIS_EVENT_TYPE=${EVENT_TYPE}" >> $GITHUB_ENV
|
||||||
echo "TRAVIS_PULL_REQUEST_BRANCH=${TRAVIS_PULL_REQUEST_BRANCH}" >> $GITHUB_ENV
|
echo "TRAVIS_PULL_REQUEST_BRANCH=${TRAVIS_PULL_REQUEST_BRANCH}" >> $GITHUB_ENV
|
||||||
echo "TRAVIS_BRANCH=${TRAVIS_BRANCH}" >> $GITHUB_ENV
|
echo "TRAVIS_BRANCH=${TRAVIS_BRANCH}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: set TAG_NPM
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
VERSION_IN_PACKAGE_JSON=$(node -p "require('./package.json')".version)
|
||||||
|
echo "version in package.json=${VERSION_IN_PACKAGE_JSON}"
|
||||||
|
if [[ ${{ inputs.branch_name }} =~ ^master(-patch.*)?$ ]]; then
|
||||||
|
# Pre-release versions
|
||||||
|
if [[ $VERSION_IN_PACKAGE_JSON =~ ^[0-9]*\.[0-9]*\.[0-9]*-A\.[0-9]*$ ]];
|
||||||
|
then
|
||||||
|
TAG_NPM=next
|
||||||
|
# Stable major versions
|
||||||
|
else
|
||||||
|
TAG_NPM=latest
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if [[ ${{ inputs.branch_name }} =~ ^develop(-patch.*)?$ ]]; then
|
||||||
|
TAG_NPM=alpha
|
||||||
|
fi
|
||||||
|
echo "TAG_NPM=${TAG_NPM}" >> $GITHUB_ENV
|
@ -1,28 +0,0 @@
|
|||||||
# TRAVIS_EVENT_TYPE= Indicates how the build was triggered. One of push, pull_request, api, cron
|
|
||||||
name: "travis-event-type-env-var"
|
|
||||||
description: "Mimic loading of a TRAVIS_EVENT_TYPE env var"
|
|
||||||
|
|
||||||
inputs:
|
|
||||||
event_name:
|
|
||||||
description: "override github.event_name"
|
|
||||||
required: false
|
|
||||||
default: ${{ github.event_name }}
|
|
||||||
runs:
|
|
||||||
using: "composite"
|
|
||||||
steps:
|
|
||||||
- name: Parse env global
|
|
||||||
run: |
|
|
||||||
EVENT_TYPE=""
|
|
||||||
REGEX="(repository|workflow)_dispatch"
|
|
||||||
if [[ "${{ inputs.event_name }}" == "schedule" ]]; then
|
|
||||||
EVENT_TYPE="cron";
|
|
||||||
elif [[ "${{ inputs.event_name }}" == "pull_request" ]]; then
|
|
||||||
EVENT_TYPE="pull_request";
|
|
||||||
elif [[ "${{ inputs.event_name }}" == "push" ]]; then
|
|
||||||
EVENT_TYPE="push";
|
|
||||||
elif [[ "${{ inputs.event_name }}" =~ $REGEX ]]; then
|
|
||||||
EVENT_TYPE="api";
|
|
||||||
fi
|
|
||||||
echo "TRAVIS_EVENT_TYPE=${EVENT_TYPE}" >> $GITHUB_ENV
|
|
||||||
echo "exporting TRAVIS_EVENT_TYPE=${EVENT_TYPE}"
|
|
||||||
shell: bash
|
|
5
.github/workflows/release.yml
vendored
5
.github/workflows/release.yml
vendored
@ -79,6 +79,9 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: ./.github/actions/setup
|
- uses: ./.github/actions/setup
|
||||||
|
with:
|
||||||
|
enable-cache: false
|
||||||
|
enable-node-modules-cache: false
|
||||||
- name: install
|
- name: install
|
||||||
run: |
|
run: |
|
||||||
npm ci
|
npm ci
|
||||||
@ -162,7 +165,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -u;
|
set -u;
|
||||||
./scripts/travis/build/bumpversion.sh
|
./scripts/travis/build/bumpversion.sh
|
||||||
nx affected:build $NX_CALCULATION_FLAGS --prod --exclude="demoshell"
|
nx affected:build $NX_CALCULATION_FLAGS --prod --exclude="demoshell" --skip-nx-cache
|
||||||
nx affected $NX_CALCULATION_FLAGS --target=pretheme
|
nx affected $NX_CALCULATION_FLAGS --target=pretheme
|
||||||
- name: release libraries
|
- name: release libraries
|
||||||
run: ./scripts/travis/release/release-npm.sh ${{ steps.set-dryrun.outputs.dryrun }}
|
run: ./scripts/travis/release/release-npm.sh ${{ steps.set-dryrun.outputs.dryrun }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user