bmatzelle / gow

Unix command line utilities installer for Windows.
https://github.com/bmatzelle/gow/wiki
6.55k stars 363 forks source link

CI workflow WIP #270

Open SM-26 opened 2 years ago

SM-26 commented 2 years ago

Hello,

I had\have a problem, where the version of the release wasn't shown anywhere I wanted to create an issue for this, but as I was doing so, I thought, why not fix it yourself and make a PR?

answer: because I have no idea what I'm doing. but YOLO NOT PRODUCTION READY

What's the problem?

when trying to update this via Winget, we don't get the version number, all we get is "unknown" image

Winget get its version info from the registry so this is way we don't see the version number in "Windows Add/Remove Programs" (appwiz.cpl) image

Where and how GOW is doing all of the registry stuff?

If I look inside setup/Gow.nsi we have !define VERSION "0.8.0-1" and after that we do have WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT}" \ "DisplayVersion" "${VERSION}" But it doesn't seem to works. when I look in the registry, at all 3 places I can think of: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\ Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

It is nowhere to be found. not just the versionNumber, but everything. when looking at the PR that added the currentVersion, https://github.com/bmatzelle/gow/pull/172 another weird thing I've found. if the version number is 0.8.0-1 why does the installer still show it as 0.8.0 (without the -1)? image

My theory

after PR 172, the .nsi file was updated, but the release page is still on 0.8.0, without this PR. other stuff as well, like the problem where the /etc folder isn't created, even though it was fixed in this commit: https://github.com/bmatzelle/gow/commit/d21710c65cc642bc20866db2cebf91ea67a38617 so I assume that the latest build (the code itself) is not the same as the released version (0.8.0)

How to solve this

I think that we need a new build based on the latest code here. only problem, I don't know how. I've made a new workflow file. but it's very dumb. it's not dynamic and I can't get the resulting artifact to publish as a release

What need to be done so this can be production ready?

in the workflow, in the artifact step:

 - name: Upload artifact
      uses: actions/upload-artifact@v1.0.0
      with:
        name:  Gow release
        path:  ${{ github.workspace }}\setup\Gow-0.8.0-1.exe

the path should not be hard coded. something like this path: ${{ github.workspace }}\setup\Gow*.exe should be the smarter option, I just can't get it to work with wildcards.

in the upload asset step:

- name: Upload asset to github release page
      id: upload-release-asset
      uses: actions/upload-release-asset@v1
      with:
        upload_url: ${{ steps.latest_release_info.outputs.upload_url }}
        asset_path: ${{ github.workspace }}\setup\Gow-0.8.0-1.exe
        asset_name: output_${{ steps.latest_release_info.outputs.tag_name }}.exe
        asset_content_type: application/octet-stream

again, asset_path should not be hard coded with file name. and also, it doesn't work at all! (something about upload_url path) so, we need someone who is a bit better than me to fix it.

the two steps named: Show me what you got can be removed.