aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Alphrag <34252790+Alphrag@users.noreply.github.com>2022-07-22 02:07:43 +0100
committerLibravatar GitHub <noreply@github.com>2022-07-22 01:07:43 +0000
commit94f71541bbec78895c3635bfb4df41d6855199ea (patch)
treeabf93e87547ba336e3e179e0537318eb3687576b
parentUpgrade 'electron' to '19.0.9' (#509) (diff)
downloadferdium-app-94f71541bbec78895c3635bfb4df41d6855199ea.tar.gz
ferdium-app-94f71541bbec78895c3635bfb4df41d6855199ea.tar.zst
ferdium-app-94f71541bbec78895c3635bfb4df41d6855199ea.zip
ci/cd: Make winget workflow ready for production [skip ci] (#508)
Fix typos and make automatic submission of update [ci skip]
-rw-r--r--.github/workflows/winget-bucket-update.yml16
1 files changed, 10 insertions, 6 deletions
diff --git a/.github/workflows/winget-bucket-update.yml b/.github/workflows/winget-bucket-update.yml
index 88314fb43..56e2871b9 100644
--- a/.github/workflows/winget-bucket-update.yml
+++ b/.github/workflows/winget-bucket-update.yml
@@ -1,3 +1,8 @@
1# This workflow will automatically submit a PR on winget-pkgs in order to update the package corresponding to the release published.
2# This can be run by hand by giving the type of release (which defaults to stable if neither '[beta]' or '[nightly]' are present in the invokation)
3# Note: This requires a personal gh token to be setup as a secret named 'FERDIUM_WINGET_PAT'
4# TODO: refactor the jobs process in order to do the parsing of the json only in one place.
5
1name: Update Ferdium package on winget 6name: Update Ferdium package on winget
2 7
3on: 8on:
@@ -64,7 +69,8 @@ jobs:
64 $lastVersion = '${{ env.last_version }}' 69 $lastVersion = '${{ env.last_version }}'
65 $versions = winget show --id '${{ env.PACKAGE_NAME }}' --versions --accept-source-agreements 70 $versions = winget show --id '${{ env.PACKAGE_NAME }}' --versions --accept-source-agreements
66 if ( $versions.Contains('${{ env.last_version }}') ) { 71 if ( $versions.Contains('${{ env.last_version }}') ) {
67 echo "version_exists='true'" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append 72 Write-Host "The last version already exists. Nothing to update."
73 echo "version_exists=true" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
68 } 74 }
69 75
70 - name: "Publish update" 76 - name: "Publish update"
@@ -85,8 +91,7 @@ jobs:
85 91
86 iwr https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe 92 iwr https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe
87 93
88 # TODO: remove -o and add -s 94 $command = ".\wingetcreate.exe update $package -v '${{ env.last_version }}' -u $installerUrls -t $ghToken -o .\ -s"
89 $command = ".\wingetcreate.exe update $package -v '${{ env.last_version }}' -u $installerUrls -t $ghToken -o .\"
90 Write-Host $command 95 Write-Host $command
91 Invoke-Expression $command 96 Invoke-Expression $command
92 97
@@ -98,7 +103,7 @@ jobs:
98 steps: 103 steps:
99 - name: Check release type 104 - name: Check release type
100 run: | 105 run: |
101 PRERELEASE_VERSION="${{ github.event.release.prerelease == 'true' }}" 106 PRERELEASE_VERSION="${{ github.event.release.prerelease }}"
102 107
103 if [[ $PRERELEASE_VERSION == "true" && ${{ contains(github.event.release.tag_name, 'nightly') }} ]]; then 108 if [[ $PRERELEASE_VERSION == "true" && ${{ contains(github.event.release.tag_name, 'nightly') }} ]]; then
104 # use the nightly version 109 # use the nightly version
@@ -129,7 +134,6 @@ jobs:
129 $package = '${{ env.PACKAGE_NAME }}' 134 $package = '${{ env.PACKAGE_NAME }}'
130 $ghToken = '${{ secrets.FERDIUM_WINGET_PAT }}' 135 $ghToken = '${{ secrets.FERDIUM_WINGET_PAT }}'
131 136
132 # TODO: remove -o and add -s 137 $command = ".\wingetcreate.exe update $package -v $($version.Trim('v')) -u $installerUrls -t $ghToken -o .\ -s"
133 $command = ".\wingetcreate.exe update $package -v $($version.Trim('v')) -u $installerUrls -t $ghToken -o .\"
134 Write-Host $command 138 Write-Host $command
135 Invoke-Command $command 139 Invoke-Command $command