Skip to content

fix(core): first forced item case (#11141) #22

fix(core): first forced item case (#11141)

fix(core): first forced item case (#11141) #22

Workflow file for this run

name: Create hotfix release
on:
push:
branches:
- hotfix_tmp_branch_for_automated_release_do_not_use
env:
NX_CLOUD_DISTRIBUTED_EXECUTION: true
NX_CLOUD_DISTRIBUTED_EXECUTION_AGENT_COUNT: 5
NX_BRANCH: ${{ github.event.number || github.ref_name }}
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_AUTH_TOKEN }}
NX_CLOUD_AUTH_TOKEN: ${{ secrets.NX_CLOUD_AUTH_TOKEN }}
jobs:
agents:
name: Runner
uses: nrwl/ci/.github/workflows/[email protected]
secrets:
NX_CLOUD_AUTH_TOKEN: ${{ secrets.NX_CLOUD_AUTH_TOKEN }}
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_AUTH_TOKEN }}
with:
number-of-agents: 5
node-version: 16.x
yarn-version: 1.22.19
ciEnv:
name: CI Environment
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- run: chmod +x .ci-env/flags.sh
- name: Using CI env flags
id: ciEnv
run: .ci-env/flags.sh
run-release:
name: Run release
runs-on: ubuntu-latest
needs: ciEnv
steps:
- name: Fetch from origin repo
uses: actions/checkout@v3
with:
ref: hotfix_tmp_branch_for_automated_release_do_not_use # always fetch from hotfix temporary branch
fetch-depth: 0
token: ${{ secrets.GHACTIONS }}
- uses: ./.github/actions/set-up-git
name: Set up git user
with:
name: ${{ secrets.GH_NAME }}
email: ${{ secrets.GH_EMAIL }}
- name: Setup Node.js and Cache
uses: ./.github/actions/nodejs
- name: Initialize the Nx Cloud distributed CI run
run: npx nx-cloud start-ci-run
- name: Bump Version
id: bumpVersion
uses: ./.github/actions/bump-version
with:
isPrerelease: false
isHotfix: ${{ !needs.ciEnv.steps.ciEnv.outputs.isLatest }}
writeFile: true
- name: Lint and build
uses: ./.github/actions/parallel-commands
with:
parallel-commands: |
npx nx run-many --target=lint --projects=i18n,cdk,core,platform,moment-adapter,datetime-adapter,cx --parallel=2
npx nx run-many --target=build-umbrella --all --parallel=1
- name: Pack libraries
run: npx nx run-many --target=prepare --projects=i18n,cdk,core,platform,moment-adapter,datetime-adapter,cx --parallel=3 --projectVersion=${{ steps.bumpVersion.outputs.newVersion }} --pack
env:
NX_CLOUD_DISTRIBUTED_EXECUTION: false
- name: Publish packages
uses: ./.github/actions/npm-publish
with:
projects: '["cdk", "core", "i18n", "platform", "moment-adapter", "datetime-adapter", "cx"]'
token: ${{ secrets.NPM_TOKEN }}
releaseTag: ${{ steps.bumpVersion.outputs.releaseTag }}
- name: Update Changelog
run: npx conventional-changelog-cli -p angular -i CHANGELOG.md -s
- uses: ./.github/actions/set-up-git
name: Set up git user
with:
name: ${{ secrets.GH_NAME }}
email: ${{ secrets.GH_EMAIL }}
- name: Commit Changes
run: |
git add .
git commit -m "chore(release): release v${{ steps.bumpVersion.outputs.newVersion }} [ci skip]" --no-verify
git tag -a v${{ steps.bumpVersion.outputs.newVersion }} -m "chore(release): release v${{ steps.bumpVersion.outputs.newVersion }} [ci skip]"
git push origin v${{ steps.bumpVersion.outputs.newVersion }}
- name: Delete temporary branch
run: |
git push origin --delete hotfix_tmp_branch_for_automated_release_do_not_use
- name: Generate Release Body
id: generate_body
uses: ./.github/actions/generate-conventional-release-notes
- name: Create Release
uses: ncipollo/[email protected]
with:
prerelease: ${{ steps.bumpVersion.outputs.isPrerelease }}
tag: v${{ steps.bumpVersion.outputs.newVersion }}
body: ${{ steps.generate_body.outputs.generatedReleaseNotes }}
update-version-on-main:
name: Update version on main
runs-on: ubuntu-latest
needs: ciEnv
if: ${{ needs.ciEnv.steps.ciEnv.outputs.isLatest }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: main # always fetch from main branch
token: ${{ secrets.GHACTIONS }}
- uses: ./.github/actions/set-up-git
name: Set up git user
with:
name: ${{ secrets.GH_NAME }}
email: ${{ secrets.GH_EMAIL }}
- name: Setup Node.js and Cache
uses: ./.github/actions/nodejs
- name: Bump Version
if: ${{ steps.ciEnv.outputs.isLatest }}
id: bumpVersion
uses: ./.github/actions/bump-version
with:
isPrerelease: false
writeFile: true
- name: Update Changelog
run: npx conventional-changelog-cli -p angular -i CHANGELOG.md -s
shell: bash
- name: Commit Changes
run: |
git add .
git commit -m "chore(release): release v${{ steps.bumpVersion.outputs.newVersion }} [ci skip]" --no-verify
git push
shell: bash
gh_pages:
name: Github Pages deploy
runs-on: ubuntu-latest
needs: ciEnv
if: ${{ needs.ciEnv.steps.ciEnv.outputs.isLatest }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: main # always fetch from main branch
token: ${{ secrets.GHACTIONS }}
- name: Setup Node.js and Cache
uses: ./.github/actions/nodejs
- name: Run build prod
run: npx nx run-many --target=build --projects=docs --configuration=production
- name: Publish to gh-pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: dist/apps/docs
token: ${{ secrets.GHACTIONS }}
repository-name: ${{ github.repository }}
stop_agents:
if: ${{ always() }}
needs:
- run-release
- update-version-on-main
- gh_pages
name: Nx Cloud - Stop Agents
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/nodejs
- name: Stop all running agents for this CI run
run: npx nx-cloud stop-all-agents