-
Notifications
You must be signed in to change notification settings - Fork 0
Add workflow for Typescript release #115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
6001920
Add workflow for Typescript release
giarc3 943f97e
Add comment about trusted publishing
giarc3 78ced5f
trigger shouldn't be here
giarc3 58630fd
Add input for --access public
giarc3 7850ad3
Run yarn
giarc3 489209f
--access public by default
giarc3 dcf8b5d
update npm
giarc3 75bdc12
debugging
giarc3 055dbce
more debugging
giarc3 d28fa35
try corepack
giarc3 7d24b62
no cache npm
giarc3 08f9293
more debugging
giarc3 487acaa
remove debugging
giarc3 d85b690
Require a working directory for publish
giarc3 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| # Publish Typescript code to NPM. This will use Trusted Publishing | ||
| # (https://docs.npmjs.com/trusted-publishers#supported-cicd-providers), so ensure it's set up for the calling repo. | ||
|
|
||
| name: Typescript Release | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| node_version: | ||
| description: "What version of node should be used when running tests/publishing." | ||
| required: false | ||
| default: "20" | ||
| type: string | ||
| pre_publish_steps: | ||
| description: "Any steps to run before publishing begins (like `build.js; cd dist`)" | ||
| required: false | ||
| default: "" | ||
| type: string | ||
| add_access_public: | ||
| description: "Add --access public to the publish command." | ||
| required: false | ||
| default: true | ||
| type: boolean | ||
| publish_working_directory: | ||
| description: "Where to run `npm publish` from" | ||
| required: true | ||
| type: string | ||
|
|
||
| permissions: | ||
| id-token: write # Required for OIDC | ||
| contents: read | ||
|
|
||
| jobs: | ||
| publish: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: ${{ inputs.node_version }} | ||
| registry-url: "https://registry.npmjs.org" | ||
| # Need newer npm to use Trusted Publishing | ||
| - name: Use newer npm version | ||
| run: | | ||
| sudo npm install -g npm@11.6.1 | ||
| # Necessary to overwrite the previous global version | ||
| echo "/usr/local/bin" >> $GITHUB_PATH | ||
| - run: yarn | ||
| - name: Pre-publish steps | ||
| if: ${{ inputs.pre_publish_steps }} != "" | ||
| run: ${{inputs.pre_publish_steps}} | ||
| - run: npm publish ${{ inputs.add_access_public && '--access public' || '' }} | ||
| working-directory: ${{ inputs.publish_working_directory }} | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't just
sudo npm installbe better? Shouldn't that always install at least 11.6.1?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I locked it to something that I knew was late enough and would give us reproducible builds. We can change it to latest later in a tag bump if we decide to