feat: use tea binary from system if available #53

Merged
earl-warren merged 2 commits from sheik/forgejo-release:feat/universal_tea_bin into main 2025-06-28 20:36:42 +00:00
Contributor

As a proposal solution to this issue: #51

We use the system installed tea binary if available or download it as it was done before if not.
The location of the binary is stored in a new variable $TEA_BIN which replaces the need for the $ BIN_DIR location.

I tested it on Alpine and Debian.

As a proposal solution to this issue: https://code.forgejo.org/actions/forgejo-release/issues/51 We use the system installed tea binary if available or download it as it was done before if not. The location of the binary is stored in a new variable `$TEA_BIN` which replaces the need for the `$ BIN_DIR` location. I tested it on Alpine and Debian.
earl-warren approved these changes 2025-06-04 06:03:00 +00:00
Dismissed
Contributor

Good workaround 👍

Good workaround 👍
earl-warren dismissed earl-warren's review 2025-06-04 06:13:43 +00:00
Reason:

CI fails

Author
Contributor

I looked at the CI logs but nothing suggests this is related to this PR. It looks like some king of GPG signature issue?
These are the error lines :

gpg: no default secret key: No secret key
gpg: signing failed: No secret key

Are the keys expired by any chance? Can you check it out?

I looked at the CI logs but nothing suggests this is related to this PR. It looks like some king of GPG signature issue? These are the error lines : ``` gpg: no default secret key: No secret key gpg: signing failed: No secret key ``` Are the keys expired by any chance? Can you check it out?
Contributor

#55

pushed a fake PR to ensure the CI is working as it should

https://code.forgejo.org/actions/forgejo-release/pulls/55 pushed a fake PR to ensure the CI is working as it should
Author
Contributor

@earl-warren wrote in #53 (comment):

#55

pushed a fake PR to ensure the CI is working as it should

Any news on fixing the CI? The fake PR fails with the same reason.

@earl-warren wrote in https://code.forgejo.org/actions/forgejo-release/pulls/53#issuecomment-42344: > #55 > > pushed a fake PR to ensure the CI is working as it should Any news on fixing the CI? The fake PR fails with the same reason.
Contributor

I forgot about it, my bad. There evidently is something environmental broken in the CI. Older runs fail when re-run.

https://code.forgejo.org/actions/forgejo-release/actions/runs/510/jobs/0#jobstep-4-639

I forgot about it, my bad. There evidently is something environmental broken in the CI. Older runs fail when re-run. https://code.forgejo.org/actions/forgejo-release/actions/runs/510/jobs/0#jobstep-4-639
Contributor

The GPG keys used in the CI expired. This will be fixed, please rebase when the PR is merged. Thanks for the reminder, it turned out to be an easy mistake to fix. Sorry it took so long.

The GPG keys used in the CI expired. [This will be fixed](https://code.forgejo.org/actions/forgejo-release/pulls/55#issuecomment-43387), please rebase when the PR is merged. Thanks for the reminder, it turned out to be an easy mistake to fix. Sorry it took so long.
Contributor

You can rebase, it should work. Rather... if it fails that will be for a different reason 😁

You can rebase, it should work. Rather... if it fails that will be for a different reason 😁
sheik force-pushed feat/universal_tea_bin from d5c70cdd09
Some checks failed
/ integration (pull_request) Failing after 3m19s
to 5f6f05b24e
All checks were successful
/ integration (pull_request) Successful in 16m8s
2025-06-27 17:05:19 +00:00
Compare
earl-warren changed title from Use tea binary from system if available to feat: use tea binary from system if available 2025-06-27 19:10:41 +00:00
earl-warren requested changes 2025-06-27 19:15:44 +00:00
Dismissed
earl-warren left a comment
Contributor

two small requests for change and then good to merge

two small requests for change and then good to merge
@ -25,3 +25,3 @@
setup_tea() {
if ! test -f "$BIN_DIR"/tea; then
if which tea; then
Contributor

which tea 2>/dev/null to reduce the noise when it is not found.

`which tea 2>/dev/null` to reduce the noise when it is not found.
Author
Contributor

Done. I wasn't get any noise when it wasn't not found but it's still good practice I guess.

Done. I wasn't get any noise when it wasn't not found but it's still good practice I guess.
@ -27,1 +27,3 @@
if ! test -f "$BIN_DIR"/tea; then
if which tea; then
TEA_BIN=$(which tea)
elif ! test -f $TEA_BIN; then
Contributor

else is enough here don't you think?

`else` is enough here don't you think?
Author
Contributor

For sure. Fixed now.

For sure. Fixed now.
@ -26,2 +26,3 @@
setup_tea() {
if ! test -f "$BIN_DIR"/tea; then
if which tea; then
TEA_BIN=$(which tea)
Contributor

Note to self: this is not covered by any test but it also is quite trivial so why not.

Note to self: this is not covered by any test but it also is quite trivial so why not.
Author
Contributor

If you give me a minute, I started giving it a go.

If you give me a minute, I started giving it a go.
Author
Contributor

I added 2 tests for each of the conditions in setup_tea(). I'm not used to write tests for bash scripts that interact with system packages and so on so my approach might not be the best. Feel free to give me feedback, change anything or scrap them entirely if you prefer to handle this at a later time.

I added 2 tests for each of the conditions in `setup_tea()`. I'm not used to write tests for bash scripts that interact with system packages and so on so my approach might not be the best. Feel free to give me feedback, change anything or scrap them entirely if you prefer to handle this at a later time.
sheik force-pushed feat/universal_tea_bin from 5f6f05b24e
All checks were successful
/ integration (pull_request) Successful in 16m8s
to 85ec83849a
All checks were successful
/ integration (pull_request) Successful in 14m26s
2025-06-28 13:47:53 +00:00
Compare
sheik force-pushed feat/universal_tea_bin from 7652117d8f
Some checks failed
/ integration (pull_request) Failing after 10m55s
to fb44c1490c
Some checks failed
/ integration (pull_request) Failing after 15m34s
2025-06-28 15:02:08 +00:00
Compare
sheik force-pushed feat/universal_tea_bin from fb44c1490c
Some checks failed
/ integration (pull_request) Failing after 15m34s
to efbafaf169
All checks were successful
/ integration (pull_request) Successful in 14m31s
2025-06-28 15:24:54 +00:00
Compare
Contributor

Perfect

Perfect ✨
earl-warren deleted branch feat/universal_tea_bin 2025-06-28 20:36:42 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
actions/forgejo-release!53
No description provided.