Conversation
roborourke
left a comment
There was a problem hiding this comment.
Is this only manually run?
Is the idea that this is copied across to other projects or referenced directly?
- If it's to be copied across, I think it needs a bunch of comments adding to explain each step, and possibly to include alternative examples for triggers that can be uncommented
- If it's to be referenced directly then what other smart defaults could we provide, e.g. multiple versions of this workflow with different triggers preconfigured like
on.push.tagsetc...
Given it's not there yet it'd be great to get a README.md with examples of how to use this, because I don't really know off the top of my head. It'll help this effort to gain traction.
|
Discussed briefly with @Sephsekla . The usage would be to link to this repository from a project, so that we reference it directly rather than copying code. jobs:
build:
uses: humanmade/hm-github-actions/.github/workflows/npm-package-release.yml@5bfc0e46c22d2724570bdc356c2e5658679d8e2e # v1.2.3(note, linking to sha vs tag is recommended by GitHub: https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions#using-third-party-actions ) This raises the question of repo structure. Should we do away with the .github folder here? Or is it valuable, so that if we have any dogfooded github actions in this repo, that they can actually run IN this repo? |
The |
| description: 'Which version of node to use for build' | ||
| type: string | ||
| required: false | ||
| default: '16.x' |
There was a problem hiding this comment.
Do we want a newer version of node? Perhaps what's used in the current WP release
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v3 |
There was a problem hiding this comment.
Do we want to pin a commit? There's a v4 of this action out
| uses: actions/checkout@v3 | ||
|
|
||
| - name: Setup Node | ||
| uses: actions/setup-node@v3 |
| run: echo "zip=$(npm pack)" > "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Create GitHub Release | ||
| uses: softprops/action-gh-release@v1 |
Create a workflow to build an npm package, and publish it to both a github release.
The recommended use here is to reference this workflow in other repos, and attach it to pushing a tag (so manually run
npm versionand push, this will do the rest).It's largely based on what we've added on https://github.com/WordPress/wp-feature-notifications/ with some changes.
This will need a readme and some proper documentation adding, but I'd appreciate an early review of the approach.