mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-10-08 14:51:14 +00:00
release workflow fixes (#3045)
This commit is contained in:
39
.github/actions/publish-libs/action.yml
vendored
39
.github/actions/publish-libs/action.yml
vendored
@@ -30,25 +30,14 @@ inputs:
|
|||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- run: npm ci
|
- uses: ./.github/actions/update-library-versions
|
||||||
|
name: Update Library Versions
|
||||||
|
with:
|
||||||
|
dry-run: ${{ inputs.dry-run }}
|
||||||
|
|
||||||
|
- name: Build Libraries
|
||||||
shell: bash
|
shell: bash
|
||||||
- name: Update Library Versions
|
run: npm ci && npm run build-libs
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
VERSION_IN_PACKAGE_JSON=$(jq -cr '.version' < package.json)
|
|
||||||
|
|
||||||
if [[ ${{ inputs.branch_name }} =~ ^master.*?$ ]] ; then
|
|
||||||
NEW_LIBRARY_VERSION="$VERSION_IN_PACKAGE_JSON"
|
|
||||||
else
|
|
||||||
NEW_LIBRARY_VERSION="${VERSION_IN_PACKAGE_JSON}-${{ github.run_id }}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo -e "Branch is '${{ inputs.branch_name }}, therefore publish with '${{ inputs.npm_tag }}' tag\n"
|
|
||||||
|
|
||||||
./scripts/gh/update-lib-versions.sh "$NEW_LIBRARY_VERSION" "${{ inputs.dry-run }}"
|
|
||||||
|
|
||||||
echo "Building projects"
|
|
||||||
npm run build-libs
|
|
||||||
|
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
name: setup GH registry
|
name: setup GH registry
|
||||||
@@ -56,11 +45,14 @@ runs:
|
|||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
registry-url: 'https://npm.pkg.github.com'
|
registry-url: 'https://npm.pkg.github.com'
|
||||||
scope: '@alfresco'
|
scope: '@alfresco'
|
||||||
|
|
||||||
- name: Publish to GH registry
|
- name: Publish to GH registry
|
||||||
shell: bash
|
shell: bash
|
||||||
run: ./scripts/gh/npm-publish.sh "${{ inputs.npm_tag }}" "${{ inputs.dry-run }}"
|
run: ./scripts/gh/npm-publish.sh "$TAG" "$DRY_RUN"
|
||||||
env:
|
env:
|
||||||
NODE_AUTH_TOKEN: ${{ inputs.github_token }}
|
NODE_AUTH_TOKEN: ${{ inputs.github_token }}
|
||||||
|
TAG: ${{ inputs.npm_tag }}
|
||||||
|
DRY_RUN: ${{ inputs.dry-run }}
|
||||||
|
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
name: setup NPM registry
|
name: setup NPM registry
|
||||||
@@ -68,8 +60,11 @@ runs:
|
|||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
registry-url: 'https://${{ inputs.npm_registry_address }}'
|
registry-url: 'https://${{ inputs.npm_registry_address }}'
|
||||||
scope: '@alfresco'
|
scope: '@alfresco'
|
||||||
|
|
||||||
- name: Publish to NPM registry
|
- name: Publish to NPM registry
|
||||||
shell: bash
|
shell: bash
|
||||||
run: ./scripts/gh/npm-publish.sh "${{ inputs.npm_tag }}" "${{ inputs.dry-run }}"
|
run: ./scripts/gh/npm-publish.sh "$TAG" "$DRY_RUN"
|
||||||
env:
|
env:
|
||||||
NODE_AUTH_TOKEN: ${{ inputs.npm_registry_token }}
|
NODE_AUTH_TOKEN: ${{ inputs.npm_registry_token }}
|
||||||
|
TAG: ${{ inputs.npm_tag }}
|
||||||
|
DRY_RUN: ${{ inputs.dry-run }}
|
||||||
|
27
.github/actions/update-library-versions/action.yml
vendored
Normal file
27
.github/actions/update-library-versions/action.yml
vendored
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
name: "Update Library Versions"
|
||||||
|
description: "Updates ACA libraries according to the root Version"
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
dry-run:
|
||||||
|
description: dry run flag
|
||||||
|
required: true
|
||||||
|
type: boolean
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Update Versions
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
VERSION_IN_PACKAGE_JSON=$(jq -cr '.version' < package.json)
|
||||||
|
|
||||||
|
if [[ ${{ inputs.branch_name }} =~ ^master.*?$ ]] ; then
|
||||||
|
NEW_LIBRARY_VERSION="$VERSION_IN_PACKAGE_JSON"
|
||||||
|
else
|
||||||
|
NEW_LIBRARY_VERSION="${VERSION_IN_PACKAGE_JSON}-${{ github.run_id }}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
./scripts/gh/update-lib-versions.sh "$NEW_LIBRARY_VERSION" "${{ inputs.dry-run }}"
|
||||||
|
|
||||||
|
echo "Building projects"
|
||||||
|
npm run build-libs
|
Reference in New Issue
Block a user