Skip to content

Native iCloud apps for Windows and Linux, built in Rust. Notes, Reminders, Calendar, Contacts, Drive and Photos, offline and in sync with your iPhone.

Stores: a first version still in review is a notice, not a failure

Yashwanth Kamireddiafd734bcd1b2
diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml
index 9f178f7..aea2cdf 100644
--- a/.github/workflows/packages.yml
+++ b/.github/workflows/packages.yml
@@ -103,6 +103,20 @@ jobs:
CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }}
run: |
if (-not $env:CHOCOLATEY_API_KEY) { throw "the CHOCOLATEY_API_KEY secret is not set" }
+ # Until a moderator approves its first version, the community repository refuses every
+ # other push (403), and every release said it failed. With no version of it approved
+ # yet, this one is kept for later and said so; once one is, a refusal is a failure.
+ $approved = $null
+ try {
+ $approved = Invoke-RestMethod "https://community.chocolatey.org/api/v2/FindPackagesById()?id='skykeep'"
+ } catch {
+ "couldn't ask the community repository ($($_.Exception.Message)); pushing anyway"
+ $approved = 'unknown'
+ }
+ if (-not $approved) {
+ "::notice::skykeep's first version is still in Chocolatey moderation: $env:VERSION is not pushed yet (re-run this job once it is approved)"
+ exit 0
+ }
choco push "out\skykeep.$env:VERSION.nupkg" --source https://push.chocolatey.org/ --api-key $env:CHOCOLATEY_API_KEY
if ($LASTEXITCODE) { throw "choco push failed ($LASTEXITCODE)" }
diff --git a/.github/workflows/stores.yml b/.github/workflows/stores.yml
index 853e11b..c76ce26 100644
--- a/.github/workflows/stores.yml
+++ b/.github/workflows/stores.yml
@@ -177,14 +177,26 @@ jobs:
KOMAC_SHA256: b03b020eec98acfb0b53e284a6e21815b884be33de6785b97e7a120f0e748966
steps:
- name: The winget token is there, and winget-pkgs has the package
+ id: has
env:
GH_TOKEN: ${{ secrets.WINGET_TOKEN }}
run: |
[ -n "$GH_TOKEN" ] || { echo "::error::the WINGET_TOKEN secret is not set: a classic token with the public_repo scope"; exit 1; }
# Komac adds a version to a package winget already has; the first one is a manual PR.
- gh api "repos/microsoft/winget-pkgs/contents/manifests/y/${IDENTIFIER//.//}" --silent \
- || { echo "::error::microsoft/winget-pkgs has no $IDENTIFIER yet: its first version's pull request must be merged first"; exit 1; }
+ if gh api "repos/microsoft/winget-pkgs/contents/manifests/y/${IDENTIFIER//.//}" --silent; then
+ echo "ready=true" >> "$GITHUB_OUTPUT"; exit 0
+ fi
+ # Not there yet: while the first version's pull request still waits for winget's
+ # moderators that is no failure, and every release said it was one. Without such a
+ # pull request open, it is.
+ open=$(gh pr list --repo microsoft/winget-pkgs --state open --search "New package: $IDENTIFIER in:title" --json number --jq 'length')
+ if [ "${open:-0}" -gt 0 ]; then
+ echo "::notice::$IDENTIFIER's first version is still waiting for winget's moderators: $VERSION goes once it is merged (re-run this job then)"
+ echo "ready=false" >> "$GITHUB_OUTPUT"; exit 0
+ fi
+ echo "::error::microsoft/winget-pkgs has no $IDENTIFIER, and no pull request for its first version is open"; exit 1
- name: Komac
+ if: steps.has.outputs.ready == 'true'
run: |
cd "$RUNNER_TEMP"
curl -fsSLo komac.tar.gz "https://github.com/russellbanks/Komac/releases/download/v$KOMAC_VERSION/komac-$KOMAC_VERSION-x86_64-unknown-linux-gnu.tar.gz"
@@ -194,6 +206,7 @@ jobs:
# The per-user NSIS installer only: the versioned name, never the .msi or the unversioned
# copy (Skykeep-windows-x64-setup.exe) that sits beside it.
- name: The pull request to microsoft/winget-pkgs
+ if: steps.has.outputs.ready == 'true'
env:
GH_TOKEN: ${{ secrets.WINGET_TOKEN }}
GITHUB_TOKEN: ${{ secrets.WINGET_TOKEN }}