Skip to content

Commit 08f5ccf

Browse files
committed
Merge test and main pre-release flow into a single file
1 parent abd7f86 commit 08f5ccf

2 files changed

Lines changed: 29 additions & 40 deletions

File tree

.github/workflows/test-main-push.yml

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

.github/workflows/test.yml

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,40 @@
1-
name: test
1+
name: Test and maybe release
22

33
on:
44
pull_request_target:
55
branches: [ main ]
6+
push:
7+
branches: [ main ]
68
workflow_dispatch:
7-
workflow_call:
8-
9-
permissions:
10-
actions: write
11-
contents: read
129

1310
jobs:
1411
run-tests:
1512
uses: MithrilJS/infra/.github/workflows/run-tests.yml@main
1613
with:
17-
all-platforms: true
1814
all-versions: true
15+
permissions:
16+
actions: write
17+
contents: read
18+
19+
publish-prerelease:
20+
needs: run-tests
21+
if: ${{ github.event_name == 'push' }}
22+
concurrency: prr:pre-release
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: actions/setup-node@v4
27+
with:
28+
node-version: 20
29+
- run: npm ci
30+
- run: npm run build
31+
- run: npx pr-release pr --verbose --target release --source main --compact --verbose --minimize-semver-change
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
34+
# The following will publish a prerelease to npm
35+
- run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
36+
name: Setup NPM Auth
37+
env:
38+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
39+
- run: npx pr-release infer-prerelease --preid=next --target release --source main --verbose --publish --minimize-semver-change
40+
name: Publish

0 commit comments

Comments
 (0)