JakeWharton / gitout

A command-line tool and Docker image to automatically backup Git repositories from GitHub or anywhere

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Upload binaries into releases from tags

JakeWharton opened this issue · comments

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

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.

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.

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.