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

GitHub Actions workflow to publish releases #16

Merged
merged 5 commits into from Nov 3, 2020

Conversation

JojOatXGME
Copy link
Contributor

@JojOatXGME JojOatXGME commented Oct 7, 2020

I created a GitHub Actions workflow to publish new releases. It can be triggered manually or by pushing a tag. You can look at a few builds here:

The generated release looks like this: Generated release on GitHub

I haven't tested the publication to the JetBrains Marketplace. I wasn't sure if it is OK to release a new version under another name just to test the publication process. It should work after adding a permanent token as secret JETBRAINS_TOKEN to the GitHub repository.

Note that after releasing a new version, the workflow does not (yet) bump the version number or update the CHANGELOG.md. If you want such feature, we can talk about it. There might be some pitfalls because other persons can push to the repository while the job is running.

@Mic92
Copy link
Member

Mic92 commented Oct 20, 2020

I could merge this but I don't know who owns the current app in the jetbrain market.

@Mic92
Copy link
Member

Mic92 commented Oct 20, 2020

cc @edwtjo @pSub could add the needed secret to this github repository?

@Mic92
Copy link
Member

Mic92 commented Oct 20, 2020

Please ping on this PR again if none of the application owner is responding and we need to look into a different way to publish it on jetbrains.

@pSub
Copy link
Member

pSub commented Oct 21, 2020

I would like to help with this. However, currently I cannot figure out how to login in my jetbrains account. There seems to be something wrong. Whenever I login with my personal account (used to upload nix-idea), I am logged in with my professional account. I hope I can figure this out later.

@Mic92
Copy link
Member

Mic92 commented Oct 23, 2020

@pSub
Copy link
Member

pSub commented Oct 30, 2020

Sorry for the delay, I was ill.

I've contacted the support and the access to the plugin has been restored for me. I've also create a permanent token. However, I cannot see the settings section for this repository to add the secret. @Mic92 Are you able to see the settings section?

@Mic92
Copy link
Member

Mic92 commented Nov 1, 2020

@pSub I cannot either right now. I pinged some folks on IRC to give you more rights.

@zimbatm
Copy link
Member

zimbatm commented Nov 1, 2020

done, you are now both admins

@pSub
Copy link
Member

pSub commented Nov 2, 2020

@zimbatm Thank you!

@Mic92 @JojOatXGME I've added a permanent token as a secret (called JETBRAINS_TOKEN) to this repository. For all I care, go ahead and try it.

@JojOatXGME
Copy link
Contributor Author

@Mic92 If you want to publish a new release, you can either push tag v0.3.0.0 (including the changes from the pull request) or merge the changes and run the workflow from the Actions section of GitHub. In both cases, you still need to bump the version number and run task patchChangelog manually afterwards.

@Mic92 Mic92 merged commit ff20d14 into NixOS:master Nov 3, 2020
@Mic92
Copy link
Member

Mic92 commented Nov 3, 2020

I triggered a test run here: https://github.com/NixOS/nix-idea/runs/1346448422?check_suite_focus=true

@Mic92
Copy link
Member

Mic92 commented Nov 3, 2020

Looks like the tooling still needs some fixes WARNING: Illegal reflective access by com.intellij.util.ReflectionUtil to field java.awt.event.InvocationEvent.runnable

@JojOatXGME
Copy link
Contributor Author

Mhh... Task buildSearchableOptions logs an exception but does not fail. Task publishPlugin fails but the error message “Failed to upload plugin” is not very helpful. I guess I should add the --stacktrace option to get more insights if something similar happens in the future.

Any idea how I can test the task without actually uploading the plugin? Or do you think it is fine to publish the plugin under a different name just to test the publication system? I can reproduce the exception in buildSearchableOptions but the failure might be caused by something else.

@Mic92
Copy link
Member

Mic92 commented Nov 4, 2020

@JojOatXGME I think it should be fine to debug publishing under a different name. Maybe make it clear from the description that this is not the official nix plugin and only for testing deployment.

@Mic92
Copy link
Member

Mic92 commented Nov 4, 2020

You may also find this useful for testing: https://github.com/marketplace/actions/debugging-with-tmate

@JojOatXGME
Copy link
Contributor Author

@Mic92 I cannot reproduce the issue. My run succeeded and I only made a few changes which I would not expect to fix the issue. Maybe it was a temporary failure of the network or JetBrains Marketplace?

In such case, you can either

  • delete the GitHub release and restart the job, or
  • upload the plugin manually to the marketplace.

In addition to adding the --stacktrace option, I could split the workflow into two workflows. That would allow to restart each workflow separately in the future. Then, you would be able to restart the publication to JetBrains without deleting the GitHub release. However, depending on the reproducibility of the build, both targets might then get a slightly different binary.

I guess it is also possible to build and save the binary in one workflow, and publish the build results in separate workflows. Anyway, I expect that such process would be more comlicated and I wanted to keep it simple at first. However, if you have any suggestions or references on how to address such problems, I'm happy to read them.

@Mic92
Copy link
Member

Mic92 commented Nov 5, 2020

@JojOatXGME JojOatXGME deleted the release_workflow branch November 5, 2020 19:19
@Mic92
Copy link
Member

Mic92 commented Nov 5, 2020

@Mic92
Copy link
Member

Mic92 commented Nov 5, 2020

@JojOatXGME
Copy link
Contributor Author

JojOatXGME commented Nov 5, 2020

This is the restart: https://github.com/NixOS/nix-idea/runs/1360104046?check_suite_focus=true

This build failed because the GitHub release already exists. Unfortunatly, the create-release action dosen't have an option to continue if the release does already exist. (EDIT: This is way you would need to delete the GitHub release for this to work. See my last comment.)

Next try: https://github.com/NixOS/nix-idea/runs/1360140607?check_suite_focus=true

This build failed because you did not change the version number. Therefore, the version number did not match the tag. You should run the patchChangelog task and change the version number in the gradle.properties. See this commit in my fork.

Beside that: My offer to split both steps into two seperate actions is still valid.

@Mic92
Copy link
Member

Mic92 commented Nov 5, 2020

@Mic92
Copy link
Member

Mic92 commented Nov 5, 2020

I cannot read the jetbrains secret so I cannot upload manually.

@JojOatXGME
Copy link
Contributor Author

JojOatXGME commented Nov 5, 2020

I get the same error again: https://github.com/NixOS/nix-idea/runs/1360166286?check_suite_focus=true#step:12:33

Ok. That is strange. I will create a new pull request which adds the --stacktrace option. Maybe that gives us more insights. Not sure what I could do otherwise. Shall I also split the workflow into two workflows as mentiond above?

I'm not sure if you want to keep the tags v0.3.0.1 and v0.3.0.2 and the GitHub release for 0.3.0.2. You may want to delete them. Not sure.

@pSub
Copy link
Member

pSub commented Nov 5, 2020

Maybe #17 fixes the problem. From what I understand in https://youtrack.jetbrains.com/issue/IDEA-234557 it should.

@JojOatXGME
Copy link
Contributor Author

JojOatXGME commented Nov 5, 2020

@pSub As far as I understand it, it should fix the exception in buildSearchableOptions. However, for me it doesn't look like this exception is actually causing the problem with the publication. At least my build had the same exception but the publication succeeded. Anyway, I might be wrong.

I created pull request #18 to add the --stacktrace option. It might help to identify the problem. I think you shold merge this change bevore trying it again. (EDIT: I mean if you want to try it again.) I'm currently also locking into spliting the workflow into two workflows.

@Mic92
Copy link
Member

Mic92 commented Nov 6, 2020

I also cannot delete tags/releases btw.

@JojOatXGME
Copy link
Contributor Author

With my changes from #19, you can trigger the publication without creating a new release. You could then try to publish the plugin again. Since we added the --stacktrace option, we might get some more informations about the failure.

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.

None yet

4 participants