Skip to content

Commit 372139b

Browse files
authored
Fix publish.yml (#1771)
* Fix publish.yml * Test * Update publish.yml * Add compliance dependence once more * Fix branch name
1 parent 40ca506 commit 372139b

File tree

3 files changed

+21
-35
lines changed

3 files changed

+21
-35
lines changed

.ado/apple-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ jobs:
248248
script: |
249249
VERSION=$(node .ado/get-next-semver-version.js)
250250
echo "Set Version to: $VERSION"
251-
condition: and(succeeded(), ne(variables['Build.TargetBranchName'], 'main'))
251+
condition: and(succeeded(), ne(variables['Build.TargetBranchName'], 'refs/heads/main'))
252252

253253

254254
- task: CmdLine@2

.ado/get-release-type.js

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

.ado/publish.yml

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# It is expected that a `latestStableBranch` variable is set in the pipeline's settings:
2-
# https://dev.azure.com/office/ISS/_apps/hub/ms.vss-build-web.ci-designer-hub?pipelineId=18541
3-
41
# This file defines the build steps to publish a release
52
name: $(Date:yyyyMMdd).$(Rev:.r)
63

@@ -9,8 +6,7 @@ trigger:
96
branches:
107
include:
118
- main
12-
- 0.68-stable
13-
- 0.71-stable
9+
- '*-stable'
1410
paths:
1511
exclude:
1612
- package.json
@@ -25,8 +21,8 @@ variables:
2521
value: production,externalfacing
2622

2723
jobs:
28-
- job: RNGithubNpmJSPublish
29-
displayName: React-Native GitHub Publish to npmjs.org
24+
- job: NPMPublishRNM
25+
displayName: NPM Publish React Native macOS
3026
pool:
3127
vmImage: $(VmImageApple)
3228
variables:
@@ -56,22 +52,31 @@ jobs:
5652
script: |
5753
VERSION=$(node .ado/get-next-semver-version.js)
5854
echo "Set version to: $VERSION"
59-
condition: and(succeeded(), ne(variables['Build.SourceBranchName'], 'main'))
55+
condition: and(succeeded(), ne(variables['Build.SourceBranch'], 'refs/heads/main'))
56+
57+
- task: CmdLine@2
58+
displayName: Set latest tag if latest stable branch
59+
inputs:
60+
script: |
61+
LATEST=true
62+
echo "Set latest to: $LATEST"
63+
condition: and(succeeded(), ne(variables['Build.SourceBranch'], 'refs/heads/main'))
6064

6165
- task: CmdLine@2
62-
displayName: Set release type
66+
displayName: Set release type to 'nightly'
6367
inputs:
6468
script: |
65-
RELEASE_TYPE=$(node .ado/get-next-release-type.js)
69+
RELEASE_TYPE=nightly
6670
echo "Set release type to: $RELEASE_TYPE"
71+
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
6772

6873
- task: CmdLine@2
69-
displayName: Set latest tag if latest stable branch
74+
displayName: Set release type to 'release'
7075
inputs:
7176
script: |
72-
LATEST=true
73-
echo "Set latest to: $LATEST"
74-
condition: eq(variables['Build.SourceBranchName'], $(latest_stable_branch))
77+
RELEASE_TYPE=release
78+
echo "Set release type to: $RELEASE_TYPE"
79+
condition: and(succeeded(), ne(variables['Build.SourceBranch'], 'refs/heads/main'))
7580

7681
- task: CmdLine@2
7782
displayName: Prepare package for release
@@ -82,7 +87,7 @@ jobs:
8287
echo "Using the version from the package.json: $VERSION"
8388
fi
8489
node ./scripts/prepare-package-for-release.js -v "$VERSION" -l $LATEST
85-
condition: and(succeeded(), ne(variables['Build.SourceBranchName'], 'main'))
90+
condition: and(succeeded(), ne(variables['Build.TargetBranch'], 'refs/heads/main'))
8691

8792
- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
8893
displayName: 📒 Generate Manifest

0 commit comments

Comments
 (0)