Sfoglia il codice sorgente

Add automatic release to winget to msi/exe ci job

Armin Schrenk 2 anni fa
parent
commit
5ba0e674f2
1 ha cambiato i file con 15 aggiunte e 0 eliminazioni
  1. 15 0
      .github/workflows/win-exe.yml

+ 15 - 0
.github/workflows/win-exe.yml

@@ -188,6 +188,21 @@ jobs:
       semVerStr: ${{ steps.versions.outputs.semVerStr }}
       revNum: ${{ steps.versions.outputs.revNum }}
 
+  publish-winget:
+    name: Publish on winget repo
+    runs-on: windows-latest
+    needs: [build-msi]
+    defaults:
+      run:
+        shell: pwsh
+    steps:
+      - name: Submit package to Windows Package Manager Community Repository
+        run: |
+          iwr https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe
+          $github = Get-Content '${{ github.event_path }}' | ConvertFrom-Json
+          $installerUrl = $github.release.assets | Where-Object -Property name -match 'Cryptomator-*.msi' | Select -ExpandProperty browser_download_url -First 1
+          .\wingetcreate.exe update Cryptomator.Cryptomator -s -v $github.release.tag_name -u $installerUrl -t ${{ secrets.CRYPTOBOT_WINGET_TOKEN }}
+
   build-exe:
     name: Build .exe installer
     runs-on: windows-latest