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

[Feature request] Add support to run on windows-latest #46

Closed
nbauma109 opened this issue Feb 9, 2022 · 7 comments
Closed

[Feature request] Add support to run on windows-latest #46

nbauma109 opened this issue Feb 9, 2022 · 7 comments
Assignees

Comments

@nbauma109
Copy link

nbauma109 commented Feb 9, 2022

After failing to build some project on unbuntu-latest, I gave a try on windows_latest.
As windows is not supported, I tried to make some custom workaround.
What exactly is blocking for Windows support ?
How do you manage the known hosts ?
and the SSH key passphrase if any ?

Here's how my workaround is configured for windows:

    runs-on: windows-latest
    if: "!contains(github.event.head_commit.message, '[maven-release-plugin]')"

    steps:
    - name: Create .ssh directory
      run: md $HOME/.ssh
    - name: Create known hosts file
      run: echo "${{ secrets.KNOWN_HOSTS }}" > $HOME/.ssh/known_hosts
    - name: Create private key
      run: echo "${{ secrets.SSH_PRIVATE_KEY }}" > $HOME/.ssh/id_ed25519
    - name: Convert to UNIX format
      run: |
        dos2unix $HOME/.ssh/known_hosts
        dos2unix $HOME/.ssh/id_ed25519
    - uses: actions/checkout@v2
    - name: Set up JDK 17
      uses: actions/setup-java@v2
      with:
        java-version: '17'
        distribution: 'temurin'
        cache: maven
    - name: Create maven settings
      uses: s4u/maven-settings-action@v2.5.0
      with:
        servers: '[{"id": "github.com", "username": "git", "privateKey": "${user.home}/.ssh/id_ed25519"}]'
    - name: Git Config
      run: |
        git config --global user.email "git@github.com"
        git config --global user.name "git"
    - name: Release with Maven
      run: mvn -B -Dusername=git release:clean release:prepare release:perform

I'd rather have the private key and known_hosts managed internally.

@qcastel
Copy link
Owner

qcastel commented Feb 9, 2022

Hello @nbauma109,

What exactly is blocking for Windows support ?

Unfortunately this github action can't support windows, as behind the scene, the maven released is done on a docker image.

You can find more details on the docker image that is used:
https://github.com/qcastel/docker-maven-release

How do you manage the known hosts ?

I did add a way for you guys to add custom known host. It is done here https://github.com/qcastel/docker-maven-release/blob/master/add-ssh-key.sh#L22
You can find here how you can use it in this maven release github action: https://github.com/qcastel/github-actions-maven-release#ssh-known-hosts

and the SSH key passphrase if any ?

You can find an example of how to setup a passphrase here:
https://github.com/qcastel/github-actions-maven-release#setup-private-maven-server-repositories

I'd rather have the private key and known_hosts managed internally.

I think with the answers above, you should be able to manage the private key and a part of the known host internally. Let me know if there is something missing that you think would be an interesting add-on to this github action.

@qcastel qcastel self-assigned this Feb 9, 2022
@qcastel
Copy link
Owner

qcastel commented Feb 9, 2022

I am also happy to assist if you got difficulties to get it work on certain repos. Sometimes troubleshooting edge cases helps me to get a better view of what needs to be implemented.

@nbauma109
Copy link
Author

Thanks for all the answers. I think I will stick with this not so great workaround.

@nbauma109
Copy link
Author

I am also happy to assist if you got difficulties to get it work on certain repos. Sometimes troubleshooting edge cases helps me to get a better view of what needs to be implemented.

indeed if you like investigating really edgy scenarios, I have this one but probably not worse spending too much time orphan-oss/launch4j-maven-plugin#167

@qcastel
Copy link
Owner

qcastel commented Feb 15, 2022

I am also happy to assist if you got difficulties to get it work on certain repos. Sometimes troubleshooting edge cases helps me to get a better view of what needs to be implemented.

indeed if you like investigating really edgy scenarios, I have this one but probably not worse spending too much time lukaszlenart/launch4j-maven-plugin#167

I had a quick look and the maven release fails during the launch4j step, which you are fully aware of.
it's not really linked to the github action but more of the support of launch4j with maven release itself. I would assume you could reproduce this by doing a maven release locally

Unfortunately I can't really help there, as it's out of bound of the maven release github action wrapper.

@qcastel qcastel closed this as completed Feb 15, 2022
@nbauma109
Copy link
Author

Hello @qcastel

But it worked on ubuntu with the maven release plugin as soon as I dropped the github-actions-maven-release.
Did you notice that ?

https://github.com/nbauma109/jd-gui-duo/blob/master/.github/workflows/maven.yml

Anyway it works now so look only if you have time.

Nicolas.

@qcastel
Copy link
Owner

qcastel commented Feb 15, 2022

What I think may have happened is that in your case, you hit your cache, whereas in the qcastel maven action, it doesnt:

In your ubuntu maven release:

 - name: Set up JDK 17
      uses: actions/setup-java@v2
      with:
        java-version: '17'
        distribution: 'temurin'
        cache: maven

Here you use a cache key maven

Whereas here, https://github.com/nbauma109/jd-gui-duo/runs/5129617422?check_suite_focus=true
I don't think you did.

So what happens is that maven release will download the jar but it won't be uncompress.

I don't know all the details of launch4j to tell you why, when doing a maven release, it appears to only download the artefact and not uncompressing it. What you could try solving is setting a cache and perhaps building it first.

I would try to troubleshoot on that direction, ie looking at the cache and see the difference there.

For example, you could compare your cache in your ubuntu gitflow and see the content of the .m2/repository/net/sf/launch4j/launch4j/3.14/launch4j-3.14-workdir-linux64/. Most likely before the release, it's already there and uncompress.

You could try to do the same on the github maven release, see if you could build a cache and inject it to the action.

@qcastel qcastel reopened this Feb 15, 2022
@qcastel qcastel closed this as completed Mar 10, 2022
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

No branches or pull requests

2 participants