Provide stable download link into Gitea releases #307

Open
opened 2023-04-10 16:22:33 +00:00 by dboreham · 3 comments
Contributor

So far we have published our release "binary" at GitHub as a release attachment. GitHub supports a scheme whereby you can request such an attachment via a stable URL and be provided with the "latest" version of said attachment. e.g. like this:

curl -L -o ~/bin/laconic-so https://github.com/cerc-io/stack-orchestrator/releases/latest/download/laconic-so

Gitea does not have this feature.

The closest it has at present is to allow a URL that is static except for the requirement to specify the tag:

curl -L -o ./laconic-so https://git.vdb.to/cerc-io/stack-orchestrator/releases/download/v1.1.0-4d1f339-202304101523/laconic-so
So far we have published our release "binary" at GitHub as a release attachment. GitHub supports a scheme whereby you can request such an attachment via a stable URL and be provided with the "latest" version of said attachment. e.g. like this: ``` curl -L -o ~/bin/laconic-so https://github.com/cerc-io/stack-orchestrator/releases/latest/download/laconic-so ``` Gitea does not have this feature. The closest it has at present is to allow a URL that is static except for the requirement to specify the tag: ``` curl -L -o ./laconic-so https://git.vdb.to/cerc-io/stack-orchestrator/releases/download/v1.1.0-4d1f339-202304101523/laconic-so ```
Author
Contributor

There is a workaround:

Hit the API to get the tag of the latest version:

 curl -s 'https://git.vdb.to/api/v1/repos/cerc-io/stack-orchestrator/releases/latest'  -H 'accept: application/json' | jq -r .tag_name
v1.1.0-4d1f339-202304101523

Then use that to pull the attachment.

There is a workaround: Hit the API to get the tag of the latest version: ``` curl -s 'https://git.vdb.to/api/v1/repos/cerc-io/stack-orchestrator/releases/latest' -H 'accept: application/json' | jq -r .tag_name v1.1.0-4d1f339-202304101523 ``` Then use that to pull the attachment.
Author
Contributor

So like:

$ latest_so_tag=$(curl -s 'https://git.vdb.to/api/v1/repos/cerc-io/stack-orchestrator/releases/latest'  -H 'accept: application/json' | jq -r .tag_name)
$ curl -L -o ./laconic-so https://git.vdb.to/cerc-io/stack-orchestrator/releases/download/${latest_so_tag}/laconic-so
So like: ``` $ latest_so_tag=$(curl -s 'https://git.vdb.to/api/v1/repos/cerc-io/stack-orchestrator/releases/latest' -H 'accept: application/json' | jq -r .tag_name) ``` ``` $ curl -L -o ./laconic-so https://git.vdb.to/cerc-io/stack-orchestrator/releases/download/${latest_so_tag}/laconic-so ```
Member

TODO: update README once transition is complete.

TODO: update README once transition is complete.
This repo is archived. You cannot comment on issues.
2 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: cerc-io/stack-orchestrator#307