-
-
Notifications
You must be signed in to change notification settings - Fork 925
41 lines (38 loc) · 1.14 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Test and maybe release
on:
pull_request_target:
branches: [ main ]
push:
branches: [ main ]
workflow_dispatch:
jobs:
run-tests:
uses: MithrilJS/infra/.github/workflows/run-tests.yml@main
with:
test-node: true
all-versions: true
permissions:
actions: write
contents: read
publish-prerelease:
needs: run-tests
if: ${{ github.event_name == 'push' }}
concurrency: prr:pre-release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm run build
- run: npx pr-release pr --verbose --target release --source main --compact --verbose --minimize-semver-change
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
# The following will publish a prerelease to npm
- run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
name: Setup NPM Auth
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: npx pr-release infer-prerelease --preid=next --target release --source main --verbose --publish --minimize-semver-change
name: Publish