Skip to content
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

Add CI job to build and upload artifact bundle for releases #1721

Conversation

calda
Copy link
Collaborator

@calda calda commented Jun 10, 2024

This PR adds a GitHub Actions CI job that builds swiftformat.artifactbundle.zip for each new release and automatically uploads / attached it to the release page.

I cut new releases regularly over in https://github.com/calda/SwiftFormat/releases, so automating this process would be helpful. To use this job in that repo I have to upstream it here. I don't know how you're managing this today, but hopefully automating this is helpful for you as well!

I verified that the artifact bundle can be consumed properly by Swift Package Manager.

Copy link

codecov bot commented Jun 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.23%. Comparing base (b0d492f) to head (ae906cb).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1721      +/-   ##
===========================================
+ Coverage    95.19%   95.23%   +0.04%     
===========================================
  Files           20       20              
  Lines        23248    23248              
===========================================
+ Hits         22131    22141      +10     
+ Misses        1117     1107      -10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@calda calda force-pushed the cal--build-artifact-bundle-for-release branch from 2e6644f to ae906cb Compare June 10, 2024 23:26
@nicklockwood nicklockwood merged commit 2ac907a into nicklockwood:develop Jun 11, 2024
7 checks passed
@nicklockwood
Copy link
Owner

This is super-helpful, thank you! Creating the artifact bundle is certainly one of the more annoying manual steps in the release process.

@nicklockwood
Copy link
Owner

I'm not sure I understand how this is triggered? I was expecting it to run automatically when the release was created, but that didn't happen. Do I need to create build jobs with particular names as you have done?

@calda
Copy link
Collaborator Author

calda commented Jun 12, 2024

When I was testing in my fork, this ran automatically after tagging a new release.

I see here that no runs of the job have been triggered: https://github.com/nicklockwood/SwiftFormat/actions/workflows/release.yml

So, I don’t know what the problem could be… maybe try again now that the commit with that job is merged to the default branch (master in your repo)? Not sure if that could be relevant or not

I'll see if I can figure out what the issue could be

@nicklockwood
Copy link
Owner

I merged it prior to tagging the release, so I don't think that's it. It might be easier just to give it a manual trigger anyway, as the release process is sometimes a bit chaotic anyway if something fails and I have to rebase and re-tag.

@calda
Copy link
Collaborator Author

calda commented Jun 12, 2024

Looking at the documentation here. Right now the job uses a release: [created] trigger:

Note: Workflows are not triggered for the created, edited, or deleted activity types for draft releases. When you create your release through the GitHub browser UI, your release may automatically be saved as a draft.

This is probably the most likely explanation.

It sounds like the recommended trigger is published rather than created:

on:
  release:
    types: [published]

@calda
Copy link
Collaborator Author

calda commented Jun 12, 2024

Maybe #1730 will fix it

@calda
Copy link
Collaborator Author

calda commented Jun 12, 2024

Here's another permission you could check: https://github.com/skx/github-action-publish-binaries#github_token

That permission being incorrect would probably make the job fail, rather than just not start in the first place. So, unlikely to be related to this specific issue. But still important to have it configured as needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants