Skip to content

Commit 03e2d7d

Browse files
committed
ci: move "NPM Publish (Dry Run)" to Github Actions
1 parent 8b0a792 commit 03e2d7d

File tree

5 files changed

+105
-2
lines changed

5 files changed

+105
-2
lines changed

.ado/apple-pr.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ stages:
2727
jobs:
2828
- template: /.ado/jobs/test-javascript.yml@self
2929

30-
- template: /.ado/jobs/npm-publish-dry-run.yml@self
31-
3230
# - stage: Integration
3331
# dependsOn: []
3432
# jobs:
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: NPM Publish Dry Run
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- '*-stable'
8+
paths-ignore:
9+
- '*.md'
10+
11+
jobs:
12+
npm-publish-dry-run:
13+
name: "NPM Publish (Dry Run)"
14+
runs-on: ubuntu-24.04
15+
env:
16+
PUBLISH_TAG: 'latest'
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
filter: blob:none
21+
fetch-depth: 0
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version: '22'
25+
- name: Configure git
26+
run: |
27+
git config --global user.email "[email protected]"
28+
git config --global user.name "React-Native Bot"
29+
git remote set-url origin https://rnbot:${{ secrets.GITHUB_TOKEN }}@github.com/microsoft/react-native-macos
30+
- name: Install dependencies
31+
run: yarn
32+
- name: Verify release config
33+
run: |
34+
node .ado/scripts/prepublish-check.mjs --verbose --tag ${{ env.PUBLISH_TAG }}
35+
36+
- name: Version and publish packages (dry run)
37+
run: |
38+
echo "Target branch: ${{ github.base_ref }}"
39+
yarn nx release --dry-run --verbose

.github/workflows/microsoft-pr.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: PR
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, edited]
6+
branches: [ "main", "*-stable", "release/*" ]
7+
8+
concurrency:
9+
# Ensure single build of a pull request. `main` should not be affected.
10+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || github.run_id }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
lint-commit:
15+
name: "Lint PR title"
16+
permissions: {}
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
filter: blob:none
22+
fetch-depth: 0
23+
- uses: actions/setup-node@v4
24+
with:
25+
node-version: '22'
26+
# We lint the PR title instead of the commit message to avoid script injection attacks.
27+
# Using environment variables prevents potential security vulnerabilities as described in:
28+
# https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions#example-of-a-script-injection-attack
29+
- name: Lint PR title
30+
env:
31+
PR_TITLE: ${{ github.event.pull_request.title }}
32+
run: |
33+
echo "$PR_TITLE" | npx @rnx-kit/[email protected]
34+
npm-publish-dry-run:
35+
name: "NPM Publish (Dry Run)"
36+
runs-on: ubuntu-24.04
37+
env:
38+
PUBLISH_TAG: 'latest'
39+
steps:
40+
- uses: actions/checkout@v4
41+
with:
42+
filter: blob:none
43+
fetch-depth: 0
44+
- uses: actions/setup-node@v4
45+
with:
46+
node-version: '22'
47+
- name: Configure git
48+
run: |
49+
git config --global user.email "[email protected]"
50+
git config --global user.name "React-Native Bot"
51+
git remote set-url origin https://rnbot:${{ secrets.GITHUB_TOKEN }}@github.com/microsoft/react-native-macos
52+
- name: Install dependencies
53+
run: yarn
54+
- name: Verify release config
55+
run: |
56+
node .ado/scripts/prepublish-check.mjs --verbose --tag ${{ env.PUBLISH_TAG }}
57+
- name: Version and publish packages (dry run)
58+
run: |
59+
echo "Target branch: ${{ github.base_ref }}"
60+
yarn nx release --dry-run --verbose

.github/workflows/npm-publish-dry-run.yml

Whitespace-only changes.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
react-native-macos: patch
3+
'@react-native-mac/virtualized-lists': patch
4+
---
5+
6+
new patch release

0 commit comments

Comments
 (0)