-
-
Notifications
You must be signed in to change notification settings - Fork 926
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge test and
main
pre-release flow into a single file
- Loading branch information
1 parent
abd7f86
commit 08f5ccf
Showing
2 changed files
with
29 additions
and
40 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,40 @@ | ||
name: test | ||
name: Test and maybe release | ||
|
||
on: | ||
pull_request_target: | ||
branches: [ main ] | ||
push: | ||
branches: [ main ] | ||
workflow_dispatch: | ||
workflow_call: | ||
|
||
permissions: | ||
actions: write | ||
contents: read | ||
|
||
jobs: | ||
run-tests: | ||
uses: MithrilJS/infra/.github/workflows/run-tests.yml@main | ||
with: | ||
all-platforms: 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 |