Skip to content

fix(platform): fix expand all functionality (#10097) #393

fix(platform): fix expand all functionality (#10097)

fix(platform): fix expand all functionality (#10097) #393

name: Create release
on:
workflow_dispatch:
push:
branches:
- main
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
initialize_cloud:
runs-on: ubuntu-latest
name: Initialize Nx Cloud
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/nodejs
- name: Initialize the Nx Cloud distributed CI run
run: npx nx-cloud start-ci-run
run-release:
name: Run release
runs-on: ubuntu-latest
needs: initialize_cloud
steps:
- name: Fetch from origin repo
uses: actions/checkout@v3
with:
ref: main # always fetch from main branch
fetch-depth: 0
token: ${{ secrets.GHACTIONS }}
- name: Setup Node.js and Cache
uses: ./.github/actions/nodejs
- name: Get next version
id: bumpVersion
uses: ./.github/actions/bump-version
with:
isPrerelease: ${{ github.event_name == 'push' }}
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 --follow-tags
- 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 }}
gh_pages:
name: Github Pages deploy
runs-on: ubuntu-latest
needs: run-release
if: ${{ github.event_name != 'push' }}
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
- 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