Skip to content

Commit 61d67fe

Browse files
committed
chore: switch to manual nightly release script
1 parent 8e8cc64 commit 61d67fe

File tree

3 files changed

+20
-21
lines changed

3 files changed

+20
-21
lines changed

.config/release-it.nightly.config.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
name: Release & Publish to NPM
1+
name: Nightly Release & Publish to NPM
22

3-
on: workflow_dispatch
3+
on:
4+
schedule:
5+
- cron: "0 0 * * *" # every day at midnight UTC
6+
workflow_dispatch: # allow manual trigger
47

58
jobs:
69
nightly:
@@ -12,21 +15,27 @@ jobs:
1215
- name: Setup
1316
uses: ./.github/actions/setup
1417

15-
- name: Initialize Git user
16-
shell: bash
17-
run: |
18-
git config user.name "github-actions"
19-
git config user.email "mwlawlor@gmail.com"
20-
2118
- name: Setup NPM registry
2219
run: |
2320
npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
2421
env:
2522
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
2623

27-
- name: Run nightly release
24+
- name: Set nightly version
2825
run: |
29-
yarn release:nightly --ci
26+
SHORT_SHA=$(git rev-parse --short HEAD)
27+
VERSION=0.0.0-nightly.$SHORT_SHA
28+
npm version $VERSION --no-git-tag-version
29+
echo "version=$VERSION" >> $GITHUB_ENV
30+
31+
- name: Check if version already exists
32+
run: |
33+
if npm view react-native-css@$version > /dev/null 2>&1; then
34+
echo "Version $version already exists. Skipping publish."
35+
exit 0
36+
fi
37+
38+
- name: Publish nightly
39+
run: npm publish --tag nightly
3040
env:
31-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3241
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@
116116
"prepare": "bob build",
117117
"prepublishOnly": "bob build",
118118
"release": "release-it --config ./.config/release-it.config.ts",
119-
"release:nightly": "release-it --config ./.config/release-it.nightly.config.ts --preRelease=nightly && git restore :/",
120119
"start": "yarn example start",
121120
"start:build": "yarn build && yarn example build",
122121
"start:debug": "yarn build && yarn example debug",

0 commit comments

Comments
 (0)