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

Upload binaries into releases from tags #8

Open
JakeWharton opened this issue May 18, 2020 · 5 comments
Open

Upload binaries into releases from tags #8

JakeWharton opened this issue May 18, 2020 · 5 comments
Labels
ci Problem with continuous integration pr welcome Open for external contribution
Milestone

Comments

@JakeWharton
Copy link
Owner

Figure out what's needed and how to upload which is built on all commits but only uploaded on tags

@JakeWharton JakeWharton modified the milestones: 0.1.0, 1.0.0 May 18, 2020
@JakeWharton JakeWharton added pr welcome Open for external contribution ci Problem with continuous integration labels May 20, 2020
@JakeWharton
Copy link
Owner Author

JakeWharton commented May 23, 2020 via email

@KSXGitHub
Copy link

but only uploaded on tags

Is this the hard part for you?

GitHub Actions has an input/output mechanism. You may feed ${{ github.ref }} as an environment variable into a script you created, that script would then determine if it is a release and set corresponding output, the step that creates release and uploads release binaries would have a condition (e.g. if: steps.release_type.outputs.is_release == 'true'). As an example, line 363-404 of my workflow contains all the steps.

@JakeWharton
Copy link
Owner Author

Nope. We already have tag-based releases to Docker and Crates.io.

It's just a matter of building the necessary binaries and uploading them in that workflow.

@KSXGitHub
Copy link

It's just a matter of building the necessary binaries and uploading them in that workflow.

Then I guess the hard part is sending build artifact from build jobs to jobs that create release?

You may use actions/upload-artifact in build jobs to upload built artifacts and actions/download-artifact to download built artifacts in jobs that upload release binaries.

My workflow has that too. It builds and releases for multiple targets in multiple platform so I have to divide it into multiple jobs:

  • build_linux, build_macos, and build_windows build release binaries and upload them as shared artifacts.
  • create_release (must be executed only once, so no matrix) that creates a release.
  • upload_release_assets that downloads shared artifacts and uploads them to GitHub Release according to strategy.matrix.target.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Problem with continuous integration pr welcome Open for external contribution
Projects
None yet
Development

No branches or pull requests

2 participants