tarides / ocaml-platform-installer

The best way for developers to write software in OCaml
ISC License
61 stars 8 forks source link

Fix --version not returning the version #147

Closed Julow closed 1 year ago

Julow commented 1 year ago

--version is returning the commit hash because the checkout step in CI is not fetching the tags.

According to the doc:

Only a single commit is fetched by default, for the ref/SHA that triggered the workflow. Set fetch-depth: 0 to fetch all history for all branches and tags. Refer here to learn which commit $GITHUB_SHA points to for different events.

Julow commented 1 year ago

Should close https://github.com/tarides/ocaml-platform-installer/issues/125

panglesd commented 1 year ago

Still outputting the wrong answer...

$ ./ocaml-platform --version
1c7de42
Julow commented 1 year ago

I have something slightly better at https://github.com/Julow/ocaml-platform/tree/test-release-action (1.7.0-4-... instead of test). Still WIP.

Julow commented 1 year ago

I seem to have fixed the issue. It might be a bug in actions/checkout, which doesn't fetch the annotated tags correctly (relevant issue: https://github.com/actions/checkout/issues/882)

panglesd commented 1 year ago

I can't find a test release in your fork with the newest fix. I would prefer if we can test this one before releasing another ocaml-platform version!

Julow commented 1 year ago

It's this one: https://github.com/Julow/ocaml-platform/releases/tag/test