-
Notifications
You must be signed in to change notification settings - Fork 325
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
feat: Adding Release Automation #1122
Changes from 8 commits
abecc22
c392dd9
123ef85
8648ba1
7fcb39d
55fc56c
5845bc4
b06eb91
cc82db8
e91de0c
a9305bb
d7a3bea
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 | ||||
---|---|---|---|---|---|---|
|
@@ -92,3 +92,62 @@ jobs: | |||||
|
||||||
- name: Show Cache | ||||||
run: du -h ${{ github.workspace }}/.cache/* || true | ||||||
|
||||||
release-pr: | ||||||
runs-on: ubuntu-latest | ||||||
needs: [test] | ||||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||||||
steps: | ||||||
- uses: google-github-actions/release-please-action@v3 | ||||||
with: | ||||||
release-type: node | ||||||
package-name: ipfs-companion | ||||||
changelog-notes-type: github | ||||||
command: release-pr | ||||||
Comment on lines
+103
to
+106
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.
This PR can stay around for as long as it's needed, as soon as that gets merged it pushes the release tags. |
||||||
|
||||||
release-assets: | ||||||
runs-on: ubuntu-latest | ||||||
needs: [test] | ||||||
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | ||||||
lidel marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
steps: | ||||||
- name: Check out Git repository | ||||||
uses: actions/checkout@v1 | ||||||
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. why downgrading to checkout@v1? 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. Other actions from the 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. |
||||||
|
||||||
- name: Install Node.js | ||||||
uses: actions/setup-node@v1 | ||||||
with: | ||||||
node-version: 18 | ||||||
|
||||||
- name: Restore .cache | ||||||
uses: actions/cache@v2 | ||||||
id: cache | ||||||
with: | ||||||
path: ${{ github.workspace }}/.cache | ||||||
key: ${{ runner.os }}-${{ hashFiles('package*json', 'package-lock.json', '*config.js') }} | ||||||
restore-keys: | | ||||||
${{ runner.os }}-${{ hashFiles('package*json', 'package-lock.json', '*config.js') }} | ||||||
${{ runner.os }}- | ||||||
|
||||||
- name: Restore node_modules | ||||||
id: yarn-cache | ||||||
uses: actions/cache@v2 | ||||||
with: | ||||||
path: node_modules | ||||||
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} | ||||||
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. just FYI: aegir actually has a great github action that allows us to cache node-modules. we should be using that most places to ensure we're consistent. 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. https://github.com/ipfs/aegir/blob/master/actions/cache-node-modules/action.yml#L27-L36 that action seems to cache |
||||||
|
||||||
- name: Install dependencies | ||||||
if: steps.yarn-cache.outputs.cache-hit != 'true' | ||||||
run: npm run ci:install | ||||||
|
||||||
- name: Build Stable Release | ||||||
run: npm run ci:build:stable | ||||||
|
||||||
- name: Release | ||||||
uses: softprops/action-gh-release@v1 | ||||||
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.
Not a blocker, but If we have to use it, please pin it to a specific revision before merging this PR:
Suggested change
For future reference, remember to add to the safelist at https://github.com/ipfs/ipfs-companion/settings/actions: 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. Thanks for the callout on adding specific version and whitelisting this.
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. Looks like |
||||||
with: | ||||||
files: build/*.zip | ||||||
lidel marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
fail_on_unmatched_files: true | ||||||
generate_release_notes: true | ||||||
draft: true | ||||||
append_body: true | ||||||
body: 'Automated Release, please upload artifacts to respective webstores and mark this draft as released.' |
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.
this only needs to run on
push
after thetests
have succeeded. Creates a release-pr based on conventional-commits commit strategy (which we already follow)This defines what a release PR is: https://github.com/google-github-actions/release-please-action#whats-a-release-pr