-
-
Notifications
You must be signed in to change notification settings - Fork 492
infra: #197/#240 create release using workflows #289
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
Changes from 12 commits
d55234f
f15fe70
50a7993
30bdb97
eda578f
2935046
e42c18b
dc354bf
07555c5
c379803
a7b934f
3020c35
9100857
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,42 @@ | ||||||
| # config borrowed from: https://docs.npmjs.com/trusted-publishers#github-actions-configuration | ||||||
| name: Release package | ||||||
|
|
||||||
| on: | ||||||
| push: | ||||||
| tags: | ||||||
| - "v*.*.*" | ||||||
|
|
||||||
| permissions: | ||||||
| id-token: write # Required for OIDC | ||||||
| contents: write | ||||||
|
|
||||||
| jobs: | ||||||
| build: | ||||||
| runs-on: ubuntu-latest | ||||||
| steps: | ||||||
| - name: Checkout | ||||||
| uses: actions/checkout@v6 | ||||||
|
|
||||||
| - name: Use Node.js 22.x | ||||||
| uses: actions/setup-node@v6 | ||||||
| with: | ||||||
| node-version: 22.x | ||||||
| cache: 'npm' | ||||||
|
|
||||||
| - run: npm version ${{ github.ref_name }} --no-git-tag-version | ||||||
|
|
||||||
| - run: npm install | ||||||
|
|
||||||
| - run: npm test | ||||||
|
|
||||||
| - run: npm pack | ||||||
|
|
||||||
| - run: npm publish | ||||||
thompson-tomo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
thompson-tomo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
|
|
||||||
| - name: Release | ||||||
| if: ${{ always() }} | ||||||
AndrewSouthpaw marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| if: ${{ always() }} | |
| if: ${{ success() }} |
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.
Agree this should ideally be changed but will wait for after trusted publishing has been confirmed as we want for the time being that if npm upload fails the artifact's is still on the github release.
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.
Sounds good. Trusted publishing is confirmed.
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.
Great @AndrewSouthpaw now it is just a matter of the housekeeping tasks ie creating the missing tag and generating release notes. See pr body for details.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |
| "author": "Thorsten Lorenz <[email protected]> (thlorenz.com)", | ||
| "name": "doctoc", | ||
| "description": "Generates TOC for markdown files of local git repo.", | ||
| "version": "2.2.0", | ||
| "version": "0.0.0-development", | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if this is a good idea, as based on my limited experience with Node.js app development, it doesn't appear to be a common practice.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For me it is better and more efficient to use a clear placeholder value rather than having to either manually maintain the version value or adding more advanced ci pipelines given low volume of releases. Note this value is used purely for informational purposes as the git tag value is used to ensure they are aligned.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't love this either. It's standard practice for the What would it take to include bumping the version tag here?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is still the case that the package version & git tags all match because at build time the value of the tag is set as the value. This means as a user they see no difference. The difficulty is if we have the trigger of a release being that a tag is added, how can we get that value to be set in the source code so that it matches. It would mean the tag is 1 commit behind. The common way to do it would be to raise a pr which bumps the version and when merged the release occurs. That would be a big change for such infrequent releases.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, ok. I'm fine with it then as long as the end result has them match. I would've gone the route of raising a PR to bump the version anyway, but this is good enough, and as you said the releases aren't that frequent. Can you add some notes to the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have added some comments and will add them here if happy. |
||
| "repository": { | ||
| "type": "git", | ||
| "url": "git://github.com/thlorenz/doctoc.git" | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.