Feature/bbcode dataprocessor data facade wo tests #728
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Pre-Release | |
on: | |
# On push on a PR we want to trigger a normal build without publishing anything | |
pull_request: | |
branches: [ main ] | |
types: | |
- opened | |
- reopened | |
- synchronize | |
- ready_for_review | |
# Manual trigger means we want to produce published prerelease artifacts for retesting purposes | |
workflow_dispatch: | |
env: | |
NODE_VERSION: 18 | |
# https://github.com/actions/runner-images/issues/70 | |
NODE_OPTIONS: "--max_old_space_size=4096" | |
PNPM_VERSION: ^8.6.9 | |
NPM_CONFIG_@coremedia:registry: 'https://npm.coremedia.io' | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
timeout-minutes: 13 | |
# do not run when if it is a manual trigger on the main branch as we have other CI for this. This one is only for feature branches | |
if: (github.event_name != 'workflow_dispatch' || github.ref != 'refs/heads/main') && !github.event.pull_request.draft | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Allocate PR Number for manual trigger | |
id: read-prnumber | |
if: github.event_name == 'workflow_dispatch' | |
run: | | |
prnumber=$(curl -s -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{github.repository}}/pulls?head=${{github.repository_owner}}:${{github.ref}} | jq -r '.[] | .number' ) | |
echo "Allocated Pull Request number ${prnumber}" | |
echo "::set-output name=prnumber::${prnumber}" | |
- name: Use Node.js ${{ env.NODE_VERSION }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Configure NPM | |
run: | | |
NPM_AUTH_TOKEN=$(curl -s -H "Accept: application/json" -H "Content-Type:application/json" -X PUT --data '{"name": "${{ secrets.CM_NPM_USER }}", "password": "${{ secrets.CM_NPM_PASSWORD }}"}' https://npm.coremedia.io/-/user/org.couchdb.user:${{ secrets.CM_NPM_USER }} | jq -r .token) | |
echo "::add-mask::$NPM_AUTH_TOKEN" | |
echo "NPM_AUTH_TOKEN=$NPM_AUTH_TOKEN" >> $GITHUB_ENV | |
echo "NPM_CONFIG_//npm.coremedia.io/:_authToken=$NPM_AUTH_TOKEN" >> $GITHUB_ENV | |
npm install -g pnpm@${{ env.PNPM_VERSION }} | |
npm install -g semver | |
- name: Setup Git | |
run: | | |
git config --global user.name 'coremedia-ci' | |
git config --global user.email '[email protected]' | |
- name: Install | |
run: pnpm install | |
- name: Set prerelease version (if triggered manually) | |
if: github.event_name == 'workflow_dispatch' | |
run: | | |
if [ -n "$(git status --porcelain)" ]; then | |
git status | |
echo "error:: There are unexpected changes in git!"; | |
exit 1 | |
fi | |
actual_version=$(cat .release-version) | |
prnumber=${{ steps.read-prnumber.outputs.prnumber }} | |
next_version=$(semver --increment prerelease --preid pr${prnumber}-${{ github.run_number }} ${actual_version}) | |
pnpm run setversion ${next_version} --filter=coremedia/* --dependencyVersion=${next_version} | |
pnpm install --no-frozen-lockfile | |
git commit -am "Set PR Version: ${next_version}" | |
echo "Chosen Pre-Release Version: ${next_version}" | |
- name: Build | |
run: pnpm build | |
- name: Lint | |
run: pnpm lint | |
- name: Test | |
run: pnpm jest | |
- name: Playwright Tests | |
run: pnpm playwright | |
- name: TypeDoc | |
run: pnpm doc | |
- name: Publish prerelease | |
if: github.event_name == 'workflow_dispatch' | |
run: | | |
pnpm install --production | |
echo '//npm.coremedia.io/:_authToken=${NPM_AUTH_TOKEN}' > .npmrc | |
pnpm publishall --registry=https://npm.coremedia.io --no-git-checks --tag pullrequest |