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

Option to change base URL in latest.json #885

Open
betamos opened this issue Aug 10, 2024 · 4 comments
Open

Option to change base URL in latest.json #885

betamos opened this issue Aug 10, 2024 · 4 comments
Labels
type: feature request New feature or request

Comments

@betamos
Copy link

betamos commented Aug 10, 2024

I use a private Github repo for my app and want to host the binaries outside of Github (in my case Cloudflare R2).

I currently:

  • Use this Github action to build the app and publish to my private repo's packages
  • Transfer the directory with all assets to a directory named after the current version in R2
  • Modify the links in latest.json manually to point to a public R2 URL, e.g. https://releases.example.com/v0.2.0/App_universal.tar.gz
  • Upload latest.json to R2

Currently, the generated latest.json file contains github URLs for the releases. I would like it to point to my host's path ( etc) instead (note this includes the version).

However, I am open to other options. Perhaps I should be not be using static files at all. Or perhaps, there should be an option to upload to S3-compatible stores instead of Github. Feel free to suggest something better.

@FabianLars FabianLars added the type: feature request New feature or request label Aug 10, 2024
@FabianLars
Copy link
Member

FabianLars commented Aug 10, 2024

Thanks for your request! Since uploading to other targets than github is currently considered out of scope for this action i will mark this as wontfix for now.

I'd love to write the latest.json file into the job output like the build artifacts but that's not possible with how the file is (currently) getting generated. 🤔

Edit: Hmm, maybe providing a (potentionally undocumented) option for a base url wouldn't be too bad. Should be simple enough.

@betamos
Copy link
Author

betamos commented Aug 10, 2024

Thanks for the swift response.

I do think all options should be documented, Github Actions is difficult enough to use as it is.

That said, to prevent XY problems: my FR is I want to host my stuff elsewhere, and that part should be common (even if Cloudflare R2 may be niche). I do want to have a full CD pipeline eventually, but I don't expect this repo to anticipate all weird use cases, like mine.

My Actions knowledge is minimal, but here's an idea:

  • Add an option to disable uploading artifacts to Github Packages
  • Add an option for base URL
  • For users like me: add a custom step after the Tauri action which uses artifactPaths output to invoke a custom upload, using e.g. FTP, S3 etc

Would something like that make sense?

@FabianLars
Copy link
Member

Uploading the packages to a release is optional if you're okay with the action not creating a github release at all. The problem is that if the action does not upload the packages, it won't be able to create a json file either because it needs to collect the packages across the different runners and it currently relies on the release for that.

At that point creating the json file from scratch yourself would probably be easier for you and us.

@betamos
Copy link
Author

betamos commented Aug 11, 2024

Ah, right. Multiple jobs makes it more complicated.

The main issue is that the artifact file names (of zip and tar files) are not deterministic within stable Tauri. They've changed in the past and might change in the future, or simply based on config changes (say MSI to NSIS).

As a result, both steps (uploading & referencing them for the updater) benefit from a single source of truth for CD purposes. So to be safe(r) I'm trusting latest.json for now (at least more than me hard-coding them). So, an optional base URL arg would be helpful. For now, I'm using sed to replace it:

sed -i -e 's#https:.*\/#https://releases.example.com/v0.2.0/#' latest.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants