Skip to content

Commit 0b2872d

Browse files
committed
ci: use nx release for publishing
1 parent 2fdc970 commit 0b2872d

File tree

3 files changed

+39
-24
lines changed

3 files changed

+39
-24
lines changed

.github/workflows/ci-change.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,17 @@ jobs:
3131

3232
- run: yarn install --frozen-lockfile
3333

34+
- name: 'Check duplicates in yarn.lock'
35+
run: yarn run dedupe --list --fail
36+
3437
- name: 'Check duplicates in yarn.lock'
3538
run: yarn run dedupe --list --fail
3639

3740
- run: yarn check-dependencies
3841

42+
- name: 'Check version plans'
43+
run: yarn nx release plan:check
44+
3945
- name: Install Playwright Browsers
4046
run: npx playwright install --with-deps
4147

azure-pipelines.yml

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,20 @@
33
pr: none
44
trigger: none
55

6+
parameters:
7+
- name: dry_run
8+
displayName: Dry run mode
9+
type: boolean
10+
default: true
11+
- name: projects # Projects to include within release. (comma/space delimited project names and/or patterns). See
12+
displayName: Projects to release (defaults to all)
13+
type: string
14+
default: ''
15+
616
variables:
17+
NX_PARALLEL: 8
18+
NX_PREFER_TS_NODE: true
19+
NX_VERBOSE_LOGGING: true
720
- group: 'Github and NPM secrets'
821
- group: InfoSec-SecurityResults
922
- name: tags
@@ -39,6 +52,9 @@ extends:
3952
targetPath: $(System.DefaultWorkingDirectory)/packages
4053
artifactName: output
4154
steps:
55+
- checkout: self
56+
persistCredentials: true
57+
4258
# For multiline scripts, we want the whole task to fail if any line of the script fails.
4359
# ADO doesn't have bash configured this way by default. To fix we override the SHELLOPTS built-in variable.
4460
# https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html
@@ -57,15 +73,26 @@ extends:
5773
- script: yarn install --frozen-lockfile
5874
displayName: Install dependencies
5975

76+
- script: |
77+
yarn nx run-many -t build,test,lint,type-check -p ${{ parameters.projects }} -nxBail
78+
displayName: Verify publish Assets
79+
6080
- script: |
6181
git config user.name "Fluent UI Build"
6282
git config user.email "fluentui-internal@service.microsoft.com"
63-
git remote set-url origin https://$(githubUser):$(githubPAT)@github.com/microsoft/fluentui-contrib.git
6483
displayName: Authenticate git for pushes
6584
6685
- script: |
67-
yarn beachball publish -b origin/main --access public -y -n $(npmToken)
68-
git reset --hard origin/main
69-
env:
70-
GITHUB_PAT: $(githubPAT)
71-
displayName: Publish to NPM & bump versions
86+
yarn nx release --skip-publish -p ${{ parameters.projects }} --dry-run ${{ parameters.dry_run }}
87+
displayName: Bump versions and generate Changelogs
88+
89+
# NOTE: this will not use cache from previous steps as package.json file changed during version bump
90+
- script: |
91+
yarn nx run-many -t build -p ${{ parameters.projects }}
92+
displayName: Prepare publish Assets
93+
94+
# TODO: move this to separate job so in case of npm failure we can re-trigger until everything is successfully published
95+
- script: |
96+
yarn nx release publish -p ${{ parameters.projects }} --dry-run ${{ parameters.dry_run }}
97+
condition: succeeded()
98+
displayName: Publish to NPM

0 commit comments

Comments
 (0)