mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
* [AAE-46514] - using by default ignore-scripts and have a trusted list for those who are trusted * [AAE-46514] - Improved the checks to cover more cases * [AAE-46514] - Fixed copilot comments * [AAE-46514] - OTher fixes * [AAE-46514] - Fixing other improvements and comments * [AAE-46514] - npmrc should be versioned to enforce the audit * [AAE-46514] - Improved code * [AAE-46514] - Removed the check on CI as we have other tools * [AAE-46514] - Improved check, updated descriptions, skip check on CI as there is already Sonar * [AAE-46514] - Reduced functions in smaller pieces * [AAE-46514] - Migrating to Pnpm to increase safety * [ci:force] - Checking * [ci:force] - Fixed complexity of the scripts * [ci:force] - Fixed complexity of the scripts * [ci:force] - Fixed wrong typing on yml * [ci:force] - Fixed sonar comments and added correct version to sha pinned action * [ci:force] - Fixed cache hit for npmn * [ci:force] - Improved eslint plugin so it can be built with standard action * [ci:force] - Improved eslint plugin so it can be built with standard action * [ci:force] - Added minimatch * [ci:force] - Fixing issues * [ci:force] - Removed 'run' as it is not needed * [ci:force] - Using audit in place of custom scripts * [ci:force] - Fixed vulnerabilities and removed custom scripts in favor of audit --critical * [ci:force] - Added minimum time for publishing to install * [ci:force] - Address issue with too new packages * [ci:force] - Address issue with too new packages
190 lines
5.9 KiB
YAML
190 lines
5.9 KiB
YAML
name: "release"
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
dry-run-flag:
|
|
description: 'enable dry-run on artifact push'
|
|
required: false
|
|
type: boolean
|
|
default: true
|
|
workflow_dispatch:
|
|
inputs:
|
|
dry-run-flag:
|
|
description: 'enable dry-run on artifact push'
|
|
required: false
|
|
type: boolean
|
|
default: true
|
|
pull_request:
|
|
types: [closed]
|
|
branches:
|
|
- develop
|
|
- develop-patch*
|
|
push:
|
|
branches:
|
|
- master
|
|
- master-patch-*
|
|
|
|
permissions:
|
|
id-token: write # Required for OIDC
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: false
|
|
|
|
env:
|
|
BASE_REF: ${{ github.base_ref }}
|
|
HEAD_REF: ${{ github.head_ref }}
|
|
GH_COMMIT: ${{ github.sha }}
|
|
GH_BUILD_NUMBER: ${{ github.run_id }}
|
|
LOG_LEVEL: "ERROR"
|
|
NODE_OPTIONS: "--max-old-space-size=5120"
|
|
|
|
jobs:
|
|
setup:
|
|
timeout-minutes: 20
|
|
if: github.event.pull_request.merged == true || github.ref_name == 'master' || github.ref_name == 'master-patch-*' || github.event_name == 'workflow_dispatch'
|
|
name: "Setup"
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: ./.github/actions/setup
|
|
with:
|
|
enable-node-modules-cache: false
|
|
- name: install
|
|
run: |
|
|
pnpm install --frozen-lockfile
|
|
pnpm bundle:js-api
|
|
pnpm bundle:cli
|
|
- uses: ./.github/actions/upload-node-modules-and-artifacts
|
|
|
|
release-npm:
|
|
needs: [setup]
|
|
outputs:
|
|
release_version: ${{ steps.set-version.outputs.release_version }}
|
|
timeout-minutes: 30
|
|
if: github.event.pull_request.merged == true || github.ref_name == 'master' || github.ref_name == 'master-patch-*' || github.event_name == 'workflow_dispatch'
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
id-token: write # Required for OIDC
|
|
contents: read
|
|
packages: write
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
fetch-depth: 0
|
|
- id: setup
|
|
uses: ./.github/actions/setup
|
|
with:
|
|
enable-node-modules-cache: false
|
|
- id: set-dryrun
|
|
uses: ./.github/actions/enable-dryrun
|
|
with:
|
|
dry-run-flag: ${{ inputs.dry-run-flag }}
|
|
- uses: ./.github/actions/download-node-modules-and-artifacts
|
|
- name: Set libraries versions
|
|
id: set-version
|
|
run: |
|
|
set -u;
|
|
./scripts/github/build/bumpversion.sh
|
|
- name: Set migrations
|
|
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
|
with:
|
|
script: |
|
|
const setMigrations = require('./scripts/github/release/set-migrations.js');
|
|
setMigrations();
|
|
- name: build libraries
|
|
run: |
|
|
pnpm build:libs
|
|
pnpm build:schematics
|
|
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
name: release libraries GH registry
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
registry-url: 'https://npm.pkg.github.com'
|
|
scope: '@alfresco'
|
|
- run: pnpm publish -- --tag=${{ steps.setup.outputs.npm-tag }}
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
name: release libraries Npm registry
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
registry-url: 'https://${{ vars.NPM_REGISTRY_ADDRESS }}'
|
|
scope: '@alfresco'
|
|
- run: pnpm publish -- --tag=${{ steps.setup.outputs.npm-tag }}
|
|
|
|
create-git-tag:
|
|
runs-on: ubuntu-latest
|
|
needs: [setup, release-npm]
|
|
if: github.event_name != 'workflow_dispatch'
|
|
name: Create github tag
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
fetch-depth: 1
|
|
- uses: './.github/actions/create-git-tag'
|
|
with:
|
|
tagName: ${{ needs.release-npm.outputs.release_version }}
|
|
|
|
npm-check-bundle:
|
|
needs: [release-npm]
|
|
timeout-minutes: 15
|
|
if: github.event.pull_request.merged == true || github.ref_name == 'master' || github.ref_name == 'master-patch-*' || github.event_name == 'workflow_dispatch'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
- uses: ./.github/actions/npm-check-bundle
|
|
|
|
push-translation-keys-to-crowdin:
|
|
name: Push translations keys to Crowdin
|
|
if: github.ref_name == 'develop' && github.event_name != 'workflow_dispatch'
|
|
runs-on: ubuntu-latest
|
|
needs: [setup]
|
|
permissions:
|
|
contents: read
|
|
packages: read
|
|
actions: read
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
|
|
- name: Push Source Files to Crowdin
|
|
uses: crowdin/github-action@8868a33591d21088edfc398968173a3b98d51706 # v2.16.2
|
|
with:
|
|
upload_sources: true
|
|
upload_sources_args: --delete-obsolete
|
|
env:
|
|
CROWDIN_TOKEN: ${{ secrets.CROWDIN_TRANSLATIONS_TOKEN }}
|
|
|
|
pull-translation-keys-from-crowdin:
|
|
needs: push-translation-keys-to-crowdin
|
|
name: Run Crowdin pull pipeline for up-to-date sync
|
|
uses: ./.github/workflows/pull-from-crowdin.yml
|
|
secrets:
|
|
BOT_GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
|
|
CROWDIN_TRANSLATIONS_TOKEN: ${{ secrets.CROWDIN_TRANSLATIONS_TOKEN }}
|
|
|
|
finalize:
|
|
if: always()
|
|
runs-on: ubuntu-latest
|
|
name: Final Results
|
|
needs: [release-npm, npm-check-bundle]
|
|
steps:
|
|
- name: Check job execution status
|
|
if: >-
|
|
${{
|
|
contains(needs.*.result, 'failure')
|
|
|| contains(needs.*.result, 'cancelled')
|
|
}}
|
|
run: exit 1
|