schemacrawler / SchemaCrawler-Installers

SchemaCrawler multi-platform installers
3 stars 4 forks source link

Package with Chocolatey #7

Closed schemacrawler closed 2 years ago

sualeh commented 2 years ago

@aalmiray - is there a way to get more detailed JReleaser logs than INFO? I have set up the Chocolatey packager, but it seems that JReleaser is not picking it up. Can you spot something obvious that I am doing wrong?

sualeh commented 2 years ago

@aalmiray - I am building on Linux. I have zip file pre-built at the download URL, and I want the PowerShell scripts generated from templates. I am not sure how the "remoteBuild" plays into this, but I have set it to true. I am wondering it is possible to generate the Chocolatey installer on Linux at all?

aalmiray commented 2 years ago

You can't generate the nuget package on Linux, the choco executable only works on Windows. That is why the remoteBuild option was added in case your build happened to run on a non-Windows OS.

Have you had a look at the docs? Did you browse the examples? If the docs are unclear then I'll have to update them.

aalmiray commented 2 years ago

@sualeh your current configuration does not define any distributions. Packagers require distribution artifacts as inputs, even if a custom downloadUrl is used, as you have done in the current configuration. this would force the GH workflow to download the target artifact first before you can release with JReleaser. Why? It's expected that all artifacts exist in the file system as they are part of the build.

Your setup may have uncovered a different use case which is repository A (SchemaCrawler) creates and publishes artifacts while repository B (SchemaCrawler-Installer) produces all installers/packagers. JReleaser was designed to be used with a single repository instead of 2.

aalmiray commented 2 years ago

@aalmiray - is there a way to get more detailed JReleaser logs than INFO?

Yes, you can pass the -g flag to enable debug. The jreleaser/release-action runs the tool as CLI thus all options shown at https://jreleaser.org/guide/latest/tools/jreleaser-cli.html are available to you if you pass them as additional arguments.

sualeh commented 2 years ago

@aalmiray - thanks. I will try out the suggestions.

aalmiray commented 2 years ago

If you install the JReleaser CLI you may test out the configuration locally by running jreleaser config or jreleaser full-release --dry-run.

sualeh commented 2 years ago

@aalmiray - thanks for your pointers. I have come much closer now.

I have added "distributions" and have been able to generate a Chocolatey bucket repo. I not sure why the Chocolatey packager is not getting published to Chocolatey, though.

You can see the complete "out" directory, which in the "Artifacts" section for the last build.

Any thoughts on what could be going on?

@adriens

aalmiray commented 2 years ago

Oh I can see it's working "as intended" except there's one problem, the GH workflow was added to a subdirectory, not at the root of the repository. This is indeed a bug in JReleaser that's somehow related to https://github.com/jreleaser/jreleaser/issues/694

https://github.com/schemacrawler/chocolatey-bucket/tree/master/schemacrawler

What you can do is to manually move the workflow files to their correct location and use the trigger workflow via the GitHub Actions UI.

aalmiray commented 2 years ago

There's one additional problem I notice in the generated workflow files, the instruction to use the apikey is wrong. Currently set to

choco apikey -k $ -s https://push.chocolatey.org/

where it should be

choco apikey -k ${{ secrets.CHOCOLATEY_API_KEY  }} -source https://push.chocolatey.org/

This is a problem caused by the template evaluation engine.

sualeh commented 2 years ago

@aalmiray - Thanks for looking. I noticed both of those things also. I can wait until you fix them in the next release of JReleaser. I am in no hurry, and I can help you test your next JReleaser version. Do you want me to submit two JReleaser issues?

aalmiray commented 2 years ago

@sualeh alright. Next release 1.0.0-M2 should come out in about 3 weeks. Couldn't fail to notice that the existing release.yml workflow could be simplified with JReleaser. Matter of fact both workflows could be merged into a single one. That might help surface other issues you may have.

Yes, please, feel free to file any issues you may encounter. Thank you 😄

sualeh commented 2 years ago

@aalmiray - That is absolutely the idea - to merge the two release workflows into a single one!

sualeh commented 2 years ago

@aalmiray - I am still having trouble with the Chocolatey build. I have switched to a local build on Windows. I have a local build now. When I run the build, I get this in the logs:

[INFO]      [chocolatey] preparing schemacrawler distribution
[DEBUG]     [chocolatey] creating props for schemacrawler/chocolatey
[DEBUG]     [chocolatey] filling distribution properties into props
[DEBUG]     [chocolatey] filling git properties into props
[DEBUG]     [chocolatey] filling artifact properties into props
[DEBUG]     [chocolatey] filling packager properties into props
[DEBUG]     [chocolatey] resolving templates for schemacrawler/chocolatey
[DEBUG]     [chocolatey] resolving templates from classpath
[DEBUG]     [chocolatey] resolving template from classpath for java-binary.chocolatey
[DEBUG]     [chocolatey] resolving template from classpath for java-binary/chocolatey/binary.nuspec.tpl
[DEBUG]     [chocolatey] resolving template from classpath for java-binary/chocolatey/tools/chocolateyinstall.ps1.tpl
[DEBUG]     [chocolatey] resolving template from classpath for java-binary/chocolatey/tools/chocolateyuninstall.ps1.tpl
[DEBUG]     [chocolatey] resolving template from classpath for java-binary/chocolatey/.github/workflows/push.yml.tpl
[DEBUG]     [chocolatey] resolving template from classpath for java-binary/chocolatey/.github/workflows/trigger.yml.tpl
[DEBUG]     [chocolatey] evaluating template binary.nuspec.tpl for schemacrawler/chocolatey
[DEBUG]     [chocolatey] writing template binary.nuspec.tpl for schemacrawler/chocolatey
[INFO]  Writing output properties to out\jreleaser\output.properties
[ERROR] JReleaser failed after 1.374 s
Unexpected error
java.lang.UnsupportedOperationException: 'posix:permissions' not supported as initial attribute
aalmiray commented 2 years ago

Do you get a full stacktrace in out/jreleaser/trace.log?

sualeh commented 2 years ago

Thanks for fixing the POSIX issue, @aalmiray

sualeh commented 2 years ago

@adriens - still working on Choclatey. They do not like email addresses in copyright messages. I will fix that and republish.

sualeh commented 2 years ago

Waiting on https://github.com/jreleaser/jreleaser/issues/741

adriens commented 2 years ago

still working on Choclatey. They do not like email addresses in copyright messages.

Yep, I saw that 😸

aalmiray commented 2 years ago

Early access build https://github.com/jreleaser/jreleaser/actions/runs/1814386793 with the fix for https://github.com/jreleaser/jreleaser/issues/741

adriens commented 2 years ago

😮

adriens commented 2 years ago

:rofl: for sure it has been achieved :heavy_heart_exclamation: :100: :people_holding_hands:

https://twitter.com/rastadidi/status/1571255820058521601