-
Notifications
You must be signed in to change notification settings - Fork 0
Add release workflow #3
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
base: development/1.0
Are you sure you want to change the base?
Conversation
Hello sylvainsenechal,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
b0e8cbd to
23e792a
Compare
17dca6a to
b424f76
Compare
a98c3be to
101daf6
Compare
58ae441 to
dbfab6d
Compare
fbf3b02 to
fe68438
Compare
fe68438 to
1e76042
Compare
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
|
.github/workflows/release.yml
Outdated
| run-name: release ${{ inputs.tag }} | ||
|
|
||
| on: | ||
| # Uncomment to test your work as a release before it's merged |
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.
We should create a RELESAE.md instead of that 🙏
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 disagree : to test release workflow, the best approach is to ..... write tests!
It is possible we do in Zenko and Vault: it allows writing tests in javascript/typescript which handle git setup, mocking GitHub (and other) APIs, and running the workflow with act in this environment.
(though sure, we could add a RELEASE.md file or section in README.md : but it should not be used for testing the release, but really to document how to do a 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.
I totally agree but I think that writing test for this simple setup is overengineered for me... Make sense for Zenko as the release workflow is much more complex.
My comment was not to not keep that here but to explain in a README that if we want to work on the workflow, we can do that and not keeping that hidden here.
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 just found the test in zenko, but I don't know if it's worth it to do it, it looks moderately complicated for a simple lib. Here, what I wanted to do more specifically is, when a developer makes modifications to the client, they can uncomment and push this, to get a tag that they can use in their other project to test
.github/workflows/release.yml
Outdated
| - name: Create Tag with Build Artifacts | ||
| run: | | ||
| # Configure git user to the GitHub Actions bot | ||
| git config --global user.name "github-actions[bot]" | ||
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
|
|
||
| # Force add the build folders (even if they are in .gitignore) | ||
| git add -f dist build | ||
|
|
||
| # Determine tag name | ||
| TAG_NAME="${{ inputs.tag }}" | ||
| if [ -z "$TAG_NAME" ]; then | ||
| TAG_NAME="test-${{ github.sha }}" | ||
| fi | ||
|
|
||
| # Commit the build artifacts | ||
| git commit -m "Build artifacts for version $TAG_NAME" | ||
|
|
||
| # Create the tag | ||
| git tag $TAG_NAME | ||
|
|
||
| # Push the tag to the repository | ||
| git push origin $TAG_NAME | ||
|
|
||
| # Export tag name for next step | ||
| echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT | ||
| id: create_tag |
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.
do we really want to push to git?
- this creates releases outside of the development branches
- this is not easily replicated for non-releases, which will makes testing integration more complex
- the repo will not look the same at all for releases & dev, can be quite confusing
- fundamentally, it uses Git as artifact storage.... while there is a dedicated tool: i.e. npm package registries...
→ should we not push to GitHub NPM registry ?
(there is an initial attempt here: scality/Guidelines#206)
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.
let's rediscuss after or during daily, i'm not familiar with npm registry, but I feel like the current method is simple and relies and less dependency than having to work with npm
.github/workflows/release.yml
Outdated
| uses: ./.github/actions/setup-smithy | ||
|
|
||
| - name: Build project | ||
| run: yarn build |
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.
does the "output" of yarn build get cached by setup-node, to speedup rebuilds?
if not, we should implement this kind of caching ourself (using actions/cache)
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 think for the release.yml, we can do it without caching.
But I've got the same problem in the test file, so I'm gonna check if I can add caching for the tests
7799483 to
b0cd583
Compare
b0cd583 to
91ed87b
Compare
ce70df1 to
1b3fe3d
Compare
ISSUE: CLDSRVCLT-7
1b3fe3d to
8ba141d
Compare
ISSUE: CLDSRVCLT-7