Skip to content

Commit

Permalink
👷 Support npm publish on other tags (#5190)
Browse files Browse the repository at this point in the history
**Description**

<!-- Please provide a short description and potentially linked issues
justifying the need for this PR -->

Until now our publication script was unable to publish on a tag not
being "latest" (the default when no tag specified). More precisely,
unable except changing the script before publishing.

With that change we make it automatic. Things on main will still be
issued on latest, things on next- will be flagged for next and all the
rest (normally backports) will fall in the legacy bucket.

<!-- * Your PR is fixing a bug or regression? Check for existing issues
related to this bug and link them -->
<!-- * Your PR is adding a new feature? Make sure there is a related
issue or discussion attached to it -->

<!-- You can provide any additional context to help into understanding
what's this PR is attempting to solve: reproduction of a bug, code
snippets... -->

**Checklist** — _Don't delete this checklist and make sure you do the
following before opening the PR_

- [x] The name of my PR follows [gitmoji](https://gitmoji.dev/)
specification
- [x] My PR references one of several related issues (if any)
- [x] New features or breaking changes must come with an associated
Issue or Discussion
- [x] My PR does not add any new dependency without an associated Issue
or Discussion
- [x] My PR includes bumps details, please run `yarn bump` and flag the
impacts properly
- [x] My PR adds relevant tests and they would have failed without my PR
(when applicable)

<!-- More about contributing at
https://github.com/dubzzz/fast-check/blob/main/CONTRIBUTING.md -->

**Advanced**

<!-- How to fill the advanced section is detailed below! -->

- [x] Category: Build chain
- [x] Impacts: Publication

<!-- [Category] Please use one of the categories below, it will help us
into better understanding the urgency of the PR -->
<!-- * ✨ Introduce new features -->
<!-- * 📝 Add or update documentation -->
<!-- * ✅ Add or update tests -->
<!-- * 🐛 Fix a bug -->
<!-- * 🏷️ Add or update types -->
<!-- * ⚡️ Improve performance -->
<!-- * _Other(s):_ ... -->

<!-- [Impacts] Please provide a comma separated list of the potential
impacts that might be introduced by this change -->
<!-- * Generated values: Can your change impact any of the existing
generators in terms of generated values, if so which ones? when? -->
<!-- * Shrink values: Can your change impact any of the existing
generators in terms of shrink values, if so which ones? when? -->
<!-- * Performance: Can it require some typings changes on user side?
Please give more details -->
<!-- * Typings: Is there a potential performance impact? In which cases?
-->
  • Loading branch information
dubzzz authored Aug 7, 2024
1 parent bad17d1 commit e00f4d6
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions .github/workflows/build-status.yml
Original file line number Diff line number Diff line change
Expand Up @@ -610,9 +610,10 @@ jobs:
name: bundles
path: packages/
- name: Publish fast-check
run: npm publish --provenance --access public packages/fast-check/package.tgz
run: npm publish --provenance --access public --tag ${{env.PUBLISH_TAG}} packages/fast-check/package.tgz
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
PUBLISH_TAG: ${{github.ref == 'refs/heads/main' && 'latest' || startsWith(github.ref, 'refs/heads/next-') && 'next' || 'legacy'}}
check_publish_ava:
name: Check publish @fast-check/ava
needs: check_any_package
Expand Down Expand Up @@ -649,9 +650,10 @@ jobs:
name: bundles
path: packages/
- name: Publish @fast-check/ava
run: npm publish --provenance --access public packages/ava/package.tgz
run: npm publish --provenance --access public --tag ${{env.PUBLISH_TAG}} packages/ava/package.tgz
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
PUBLISH_TAG: ${{github.ref == 'refs/heads/main' && 'latest' || startsWith(github.ref, 'refs/heads/next-') && 'next' || 'legacy'}}
check_publish_jest:
name: Check publish @fast-check/jest
needs: check_any_package
Expand Down Expand Up @@ -688,9 +690,10 @@ jobs:
name: bundles
path: packages/
- name: Publish @fast-check/jest
run: npm publish --provenance --access public packages/jest/package.tgz
run: npm publish --provenance --access public --tag ${{env.PUBLISH_TAG}} packages/jest/package.tgz
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
PUBLISH_TAG: ${{github.ref == 'refs/heads/main' && 'latest' || startsWith(github.ref, 'refs/heads/next-') && 'next' || 'legacy'}}
check_publish_packaged:
name: Check publish @fast-check/packaged
needs: check_any_package
Expand Down Expand Up @@ -727,9 +730,10 @@ jobs:
name: bundles
path: packages/
- name: Publish @fast-check/packaged
run: npm publish --provenance --access public packages/packaged/package.tgz
run: npm publish --provenance --access public --tag ${{env.PUBLISH_TAG}} packages/packaged/package.tgz
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
PUBLISH_TAG: ${{github.ref == 'refs/heads/main' && 'latest' || startsWith(github.ref, 'refs/heads/next-') && 'next' || 'legacy'}}
check_publish_poisoning:
name: Check publish @fast-check/poisoning
needs: check_any_package
Expand Down Expand Up @@ -766,9 +770,10 @@ jobs:
name: bundles
path: packages/
- name: Publish @fast-check/poisoning
run: npm publish --provenance --access public packages/poisoning/package.tgz
run: npm publish --provenance --access public --tag ${{env.PUBLISH_TAG}} packages/poisoning/package.tgz
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
PUBLISH_TAG: ${{github.ref == 'refs/heads/main' && 'latest' || startsWith(github.ref, 'refs/heads/next-') && 'next' || 'legacy'}}
check_publish_vitest:
name: Check publish @fast-check/vitest
needs: check_any_package
Expand Down Expand Up @@ -805,9 +810,10 @@ jobs:
name: bundles
path: packages/
- name: Publish @fast-check/vitest
run: npm publish --provenance --access public packages/vitest/package.tgz
run: npm publish --provenance --access public --tag ${{env.PUBLISH_TAG}} packages/vitest/package.tgz
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
PUBLISH_TAG: ${{github.ref == 'refs/heads/main' && 'latest' || startsWith(github.ref, 'refs/heads/next-') && 'next' || 'legacy'}}
check_publish_worker:
name: Check publish @fast-check/worker
needs: check_any_package
Expand Down Expand Up @@ -844,9 +850,10 @@ jobs:
name: bundles
path: packages/
- name: Publish @fast-check/worker
run: npm publish --provenance --access public packages/worker/package.tgz
run: npm publish --provenance --access public --tag ${{env.PUBLISH_TAG}} packages/worker/package.tgz
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
PUBLISH_TAG: ${{github.ref == 'refs/heads/main' && 'latest' || startsWith(github.ref, 'refs/heads/next-') && 'next' || 'legacy'}}
check_publish_expect_type:
name: Check publish @fast-check/expect-type
needs: check_any_package
Expand Down Expand Up @@ -883,6 +890,7 @@ jobs:
name: bundles
path: packages/
- name: Publish @fast-check/expect-type
run: npm publish --provenance --access public packages/expect-type/package.tgz
run: npm publish --provenance --access public --tag ${{env.PUBLISH_TAG}} packages/expect-type/package.tgz
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
PUBLISH_TAG: ${{github.ref == 'refs/heads/main' && 'latest' || startsWith(github.ref, 'refs/heads/next-') && 'next' || 'legacy'}}

0 comments on commit e00f4d6

Please sign in to comment.