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

ci(releases): fetch tools versions in its own job #547

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

nikaro
Copy link
Contributor

@nikaro nikaro commented Feb 5, 2024

Fixes: #542

In #496 i introduced a bug in the release process by referencing a not yet defined environment variable env.RELEASE_VERSION in the matrix.
Causing this failure: https://github.com/tamasfe/taplo/actions/runs/7742605055/workflow#L268

This can be fixed by extracting the version fetching steps in its own get_version job and make jobs that require it to depend on it. Then instead of referencing an environment variable we use the get_version job outputs.

I also added the workflow_dispatch trigger to allow running the release workflow manually. So that it should be possible to re-run it to fix the releases, using the desired tag as the git ref:
Capture d’écran 2024-02-05 à 11 41 55

I've created a dummy repository to test the workflow logic (by fetching and echoing the versions) and it works fine: https://github.com/nikaro/github-actions-testing/actions/workflows/releases-taplo.yaml

@JounQin
Copy link
Collaborator

JounQin commented Feb 5, 2024

Thanks for working this!

@JounQin JounQin merged commit 1aed562 into tamasfe:master Feb 7, 2024
4 checks passed
@nikaro nikaro deleted the ci-fix-releases branch February 7, 2024 17:34
@JounQin
Copy link
Collaborator

JounQin commented Feb 16, 2024

https://github.com/tamasfe/taplo/releases/tag/release-taplo-cli-0.9.1

@nikaro It seems tags are not released automatically anymore?

@JounQin
Copy link
Collaborator

JounQin commented Feb 18, 2024

Invalid workflow file: .github/workflows/releases.yaml#L268
The workflow is not valid. .github/workflows/releases.yaml (Line: 268, Col: 19): Unrecognized named-value: 'env'. Located at position 1 within expression: env.RELEASE_VERSION .github/workflows/releases.yaml (Line: 270, Col: 19): Unrecognized named-value: 'env'. Located at position 1 within expression: env.RELEASE_VERSION

@JounQin JounQin mentioned this pull request Feb 18, 2024
@nikaro
Copy link
Contributor Author

nikaro commented Feb 18, 2024

@JounQin the changes i did in this PR was to fix this issue specifically. But if you run the workflow with a tag prior to the PR i think that it still use the previous buggy version of the workflow.

You may need create a new one or override the existing one to point to more recent commit (on or after the workflow fix).

@JounQin
Copy link
Collaborator

JounQin commented Feb 18, 2024

@nikaro So the release must be manual triggered now?

@nikaro
Copy link
Contributor Author

nikaro commented Feb 18, 2024

No, the trigger is still on tags pushes:

on:
  push:
    tags:
      - release-*

@JounQin
Copy link
Collaborator

JounQin commented Feb 19, 2024

https://github.com/tamasfe/taplo/tags

@nikaro They're not released automatically. (created 3 days ago)

@nikaro
Copy link
Contributor Author

nikaro commented Feb 19, 2024

Ok, i think i understand what's hapenning.

The Continuous integration / Tag Releases did run correctly, pushing new tags: https://github.com/tamasfe/taplo/actions/runs/7920213073/job/21622733377

But since @JounQin is the author here, it looks like the GitHub Personal Access Token of @tamasfe (in secrets.WORKFLOW_PAT) is not accessible. Thus it is empty and/or falls back on the "default" one, GITHUB_TOKEN, which cannot trigger another workflow (cf. doc).

At least that's the only explanation i can think of. Because the Release workflow trigger didn't changed on this part it shouldn't behave differently than before. And i can (sort of) reproduce it:

Did you try to run the workflow manually targeting the tags? In the meantime this could at least let us know if the Release workflow itself is working fine now.

@nikaro
Copy link
Contributor Author

nikaro commented Feb 19, 2024

Or maybe the secrets.WORKFLOW_PAT has been removed, or the PAT it references is expired? Or something like that...

@ia0
Copy link
Collaborator

ia0 commented Feb 19, 2024

Thanks for the debugging work @nikaro !

@JounQin I guess you're the only one who can check the Settings page of the repository to check if the secrets are present. Otherwise, it's probably simpler to let @tamasfe push the release (once prepared). What do you think?

@JounQin
Copy link
Collaborator

JounQin commented Feb 19, 2024

I don't have the permission to check the Settings page. 🤣

Organization is much flexible for permission model.

@ia0
Copy link
Collaborator

ia0 commented Feb 19, 2024

Ah ok :D that solves it then. I think it's better if @tamasfe does the releases then, although we can still prepare them to minimize work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

latest release doesn't contain precompiled binaries
3 participants