Native iCloud apps for Windows and Linux, built in Rust. Notes, Reminders, Calendar, Contacts, Drive and Photos, offline and in sync with your iPhone.
Rust apple-notesapple-reminderscloudkitcrdtdesktop-appicloudicloud-calendaricloud-driveicloud-notesicloud-photosiphonelinuxlinux-desktoplocal-firstoffline-firstprivacyrusttauritauri-appwindows
Stores: every published release goes to Snap, Chocolatey, Scoop, winget and the MSIX build
Yashwanth Kamireddi77013c4c3213
diff --git a/.github/workflows/msix.yml b/.github/workflows/msix.ymlindex 3b55084..cac88ec 100644--- a/.github/workflows/msix.yml+++ b/.github/workflows/msix.yml@@ -13,7 +13,8 @@# The identity (Partner Center → the app → Product identity) is taken from this run's inputs,# else from the repository variables MSIX_IDENTITY_NAME, MSIX_PUBLISHER and# MSIX_PUBLISHER_DISPLAY_NAME, else from stand-ins that make a package fit only for the test-# install here — never for the Store.+# install here — never for the Store. A published release (stores.yml) calls it with `store` on,+# which refuses the stand-ins: the artifact it keeps is the one uploaded to Partner Center.name: MSIX for the Microsoft Storeon:@@ -35,6 +36,24 @@ on:description: "Release tag to build, such as v0.1.4 (empty: this branch)"type: stringdefault: ""+ workflow_call:+ inputs:+ identity_name:+ type: string+ default: ""+ publisher:+ type: string+ default: ""+ publisher_display_name:+ type: string+ default: ""+ tag:+ type: string+ default: ""+ # For the Store: fail unless the identity is Partner Center's, never the stand-ins.+ store:+ type: boolean+ default: falsepermissions:contents: read@@ -55,6 +74,20 @@ jobs:PUBLISHER: ${{ inputs.publisher || vars.MSIX_PUBLISHER || 'CN=Skykeep Test' }}PUBLISHER_DISPLAY_NAME: ${{ inputs.publisher_display_name || vars.MSIX_PUBLISHER_DISPLAY_NAME || 'Skykeep Test' }}steps:+ - name: The Store's identity, not the stand-ins+ if: inputs.store+ shell: pwsh+ env:+ GIVEN_NAME: ${{ inputs.identity_name || vars.MSIX_IDENTITY_NAME }}+ GIVEN_PUBLISHER: ${{ inputs.publisher || vars.MSIX_PUBLISHER }}+ GIVEN_DISPLAY_NAME: ${{ inputs.publisher_display_name || vars.MSIX_PUBLISHER_DISPLAY_NAME }}+ run: |+ $missing = @()+ if (-not $env:GIVEN_NAME) { $missing += "MSIX_IDENTITY_NAME" }+ if (-not $env:GIVEN_PUBLISHER) { $missing += "MSIX_PUBLISHER" }+ if (-not $env:GIVEN_DISPLAY_NAME) { $missing += "MSIX_PUBLISHER_DISPLAY_NAME" }+ if ($missing) { throw "a Store package needs Partner Center's identity; set the repository variables: $($missing -join ', ')" }+ "identity: $env:IDENTITY_NAME, $env:PUBLISHER, $env:PUBLISHER_DISPLAY_NAME"- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2with:diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.ymlindex fd6e174..510998d 100644--- a/.github/workflows/packages.yml+++ b/.github/workflows/packages.yml@@ -7,6 +7,8 @@# copr — on each Fedora, makes the source RPM with .copr/Makefile exactly as COPR does,# rebuilds it with rpmbuild, and installs and runs the package in a clean container# of that Fedora (packaging/linux-compat/check.sh).+# A published release (stores.yml) calls it with publish on and copr off: COPR builds each tag+# itself, from its webhook.name: Packageson:@@ -20,6 +22,24 @@ on:description: "Push the tested Chocolatey package to community.chocolatey.org"type: booleandefault: false+ copr:+ description: "Also build and run the Fedora COPR package"+ type: boolean+ default: true+ workflow_call:+ inputs:+ version:+ type: string+ required: true+ publish:+ type: boolean+ default: false+ copr:+ type: boolean+ default: true+ secrets:+ CHOCOLATEY_API_KEY:+ required: falsepermissions:contents: read@@ -151,6 +171,7 @@ jobs:# A HEIC made for check.sh, as linux-compat.yml makes it: Fedora's heif-enc has no HEVC# encoder.heic:+ if: inputs.coprruns-on: ubuntu-24.04steps:- run: |@@ -171,6 +192,7 @@ jobs:copr-build:name: COPR build (Fedora ${{ matrix.fedora }})+ if: inputs.coprruns-on: ubuntu-24.04timeout-minutes: 90strategy:diff --git a/.github/workflows/snap.yml b/.github/workflows/snap.ymlindex 2d9cc50..6195665 100644--- a/.github/workflows/snap.yml+++ b/.github/workflows/snap.yml@@ -1,6 +1,6 @@# Builds the Snap from the release's .deb and checks that it installs and starts (offline, under# a virtual display). Uploading to the Snap Store needs SNAPCRAFT_STORE_CREDENTIALS and is a-# separate step, run only on a tag.+# separate step, run only when asked: by hand (publish), or by a published release (stores.yml).name: Snapon:@@ -13,6 +13,18 @@ on:description: Upload to the Snap Store (stable)type: booleandefault: false+ # A published release (stores.yml): the same build and check, then the upload.+ workflow_call:+ inputs:+ tag:+ type: string+ required: true+ publish:+ type: boolean+ default: false+ secrets:+ SNAPCRAFT_STORE_CREDENTIALS:+ required: falsepush:branches: [snap]@@ -62,11 +74,17 @@ jobs:publish:# Uploads the tested snap to the Snap Store's stable channel. Runs only when asked, with the- # store credential (snapcraft export-login) saved as SNAPCRAFT_STORE_CREDENTIALS.+ # store credential (snapcraft export-login) saved as SNAPCRAFT_STORE_CREDENTIALS. A push to+ # the snap branch has no inputs, so it never publishes.needs: build- if: github.event_name == 'workflow_dispatch' && inputs.publish+ if: inputs.publishruns-on: ubuntu-24.04steps:+ - name: The store credential is there+ env:+ SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}+ run: |+ [ -n "$SNAPCRAFT_STORE_CREDENTIALS" ] || { echo "::error::the SNAPCRAFT_STORE_CREDENTIALS secret is not set (snapcraft export-login)"; exit 1; }- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2with:name: skykeep-snapdiff --git a/.github/workflows/stores.yml b/.github/workflows/stores.ymlnew file mode 100644index 0000000..853e11b--- /dev/null+++ b/.github/workflows/stores.yml@@ -0,0 +1,219 @@+# Every store, from one published release. release.yml makes a draft; publishing it+# (`gh release edit vX.Y.Z --draft=false`) runs this, and each channel takes that release:+# resolve — the release is published, not a prerelease, its tag is vX.Y.Z and it has+# SHA256SUMS-windows.txt; nothing else runs otherwise;+# snap — snap.yml: the Snap built from the release's .deb, installed and started, then+# uploaded to the Snap Store's stable channel (SNAPCRAFT_STORE_CREDENTIALS);+# chocolatey — packages.yml: the Chocolatey package and the Scoop manifest installed, checked+# and uninstalled on Windows, then the .nupkg pushed (CHOCOLATEY_API_KEY);+# scoop — bucket/skykeep.json in the scoop-bucket repository moved to the release: its+# version, its URL and the installer's hash, checked against the file itself+# (SCOOP_BUCKET_TOKEN);+# winget — a pull request to microsoft/winget-pkgs from the owner's fork, made by Komac+# from the release's NSIS installer (WINGET_TOKEN);+# msix — msix.yml: the unsigned Microsoft Store package, kept as the `skykeep-msix`+# artifact for the owner to upload to Partner Center (there is no upload here).+# COPR needs nothing: it builds each new tag from its own GitHub webhook.+#+# A release published with a person's token (gh, the web page) starts this; one published by a+# workflow's GITHUB_TOKEN would not, as GitHub never lets that token start another workflow.+# Re-run one release by hand: Actions → Stores → Run workflow, with its tag. Channels that+# already have the version say so: Scoop and winget leave it as it is; Chocolatey's push and+# the Snap upload are refused or add a revision, as those stores decide.+name: Stores++on:+ release:+ types: [published]+ workflow_dispatch:+ inputs:+ tag:+ description: "The published release to send to every store, such as v0.1.5"+ type: string+ required: true++permissions: {}++concurrency:+ group: stores-${{ github.event.release.tag_name || inputs.tag }}+ cancel-in-progress: false++jobs:+ resolve:+ runs-on: ubuntu-24.04+ timeout-minutes: 5+ permissions:+ contents: read+ outputs:+ tag: ${{ steps.release.outputs.tag }}+ version: ${{ steps.release.outputs.version }}+ go: ${{ steps.release.outputs.go }}+ steps:+ - id: release+ env:+ GH_TOKEN: ${{ github.token }}+ REPO: ${{ github.repository }}+ TAG: ${{ github.event.release.tag_name || inputs.tag }}+ run: |+ if ! printf '%s' "$TAG" | grep -Eq '^v[0-9]+\.[0-9]+\.[0-9]+$'; then+ echo "::error::'$TAG' is not a release tag (vX.Y.Z)"; exit 1+ fi+ info=$(gh release view "$TAG" --repo "$REPO" --json isDraft,isPrerelease,assets) \+ || { echo "::error::no release $TAG (a draft is not published yet)"; exit 1; }+ if [ "$(jq -r .isDraft <<<"$info")" = true ]; then+ echo "::error::$TAG is still a draft: publish it first"; exit 1+ fi+ if [ "$(jq -r .isPrerelease <<<"$info")" = true ]; then+ echo "::notice::$TAG is a prerelease: no store gets it"+ echo "go=false" >> "$GITHUB_OUTPUT"; exit 0+ fi+ jq -e '.assets[] | select(.name == "SHA256SUMS-windows.txt")' <<<"$info" >/dev/null \+ || { echo "::error::$TAG has no SHA256SUMS-windows.txt"; exit 1; }+ { echo "tag=$TAG"; echo "version=${TAG#v}"; echo "go=true"; } >> "$GITHUB_OUTPUT"+ echo "$TAG goes to every store"++ snap:+ needs: resolve+ if: needs.resolve.outputs.go == 'true'+ permissions:+ contents: read+ uses: ./.github/workflows/snap.yml+ with:+ tag: ${{ needs.resolve.outputs.tag }}+ publish: true+ secrets:+ SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}++ chocolatey:+ needs: resolve+ if: needs.resolve.outputs.go == 'true'+ permissions:+ contents: read+ uses: ./.github/workflows/packages.yml+ with:+ version: ${{ needs.resolve.outputs.version }}+ publish: true+ copr: false+ secrets:+ CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }}++ scoop:+ needs: resolve+ if: needs.resolve.outputs.go == 'true'+ runs-on: ubuntu-24.04+ timeout-minutes: 10+ permissions:+ contents: read+ env:+ TAG: ${{ needs.resolve.outputs.tag }}+ VERSION: ${{ needs.resolve.outputs.version }}+ BUCKET: ${{ github.repository_owner }}/scoop-bucket+ REPO: ${{ github.repository }}+ steps:+ - name: The bucket's token is there+ env:+ SCOOP_BUCKET_TOKEN: ${{ secrets.SCOOP_BUCKET_TOKEN }}+ run: |+ [ -n "$SCOOP_BUCKET_TOKEN" ] || { echo "::error::the SCOOP_BUCKET_TOKEN secret is not set: a fine-grained token with Contents read and write on $BUCKET only"; exit 1; }+ - name: The installer, checked against SHA256SUMS-windows.txt+ env:+ GH_TOKEN: ${{ github.token }}+ run: |+ mkdir "$RUNNER_TEMP/release"; cd "$RUNNER_TEMP/release"+ installer="Skykeep_${VERSION}_x64-setup.exe"+ gh release download "$TAG" --repo "$REPO" -p SHA256SUMS-windows.txt -p "$installer"+ # Written on Windows: CRLF line ends.+ hash=$(tr -d '\r' < SHA256SUMS-windows.txt | awk -v f="$installer" '$2 == f { print tolower($1) }')+ [ "${#hash}" -eq 64 ] || { echo "::error::no hash for $installer in SHA256SUMS-windows.txt"; exit 1; }+ echo "$hash $installer" | sha256sum -c -+ echo "HASH=$hash" >> "$GITHUB_ENV"+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1+ with:+ repository: ${{ env.BUCKET }}+ token: ${{ secrets.SCOOP_BUCKET_TOKEN }}+ path: bucket-repo+ # Only the version, the URL and the hash change, in place: the rest of the manifest (its+ # notes, which name versions of their own, and its layout) stays as written.+ - name: bucket/skykeep.json moved to the release+ working-directory: bucket-repo+ run: |+ f=bucket/skykeep.json+ old=$(jq -r .version "$f")+ oldhash=$(jq -r '.architecture."64bit".hash' "$f")+ url="https://github.com/$REPO/releases/download/$TAG/Skykeep_${VERSION}_x64-setup.exe#/dl.7z"+ if [ "$old" = "$VERSION" ] && [ "$oldhash" = "$HASH" ]; then+ echo "::notice::the bucket already has Skykeep $VERSION"; exit 0+ fi+ oldv=$(printf '%s' "$old" | sed 's/\./\\./g')+ sed -i -E \+ -e "s|^(\s*\"version\": )\"$oldv\"|\1\"$VERSION\"|" \+ -e "s|(\"url\": )\"https://[^\"]*/v$oldv/Skykeep_${oldv}_x64-setup\.exe#/dl\.7z\"|\1\"$url\"|" \+ -e "s|(\"hash\": )\"$oldhash\"|\1\"$HASH\"|" \+ "$f"+ jq -e --arg v "$VERSION" --arg u "$url" --arg h "$HASH" \+ '.version == $v and .architecture."64bit".url == $u and .architecture."64bit".hash == $h+ and (.autoupdate.architecture."64bit".hash.url | endswith("SHA256SUMS-windows.txt"))' "$f" >/dev/null \+ || { echo "::error::bucket/skykeep.json did not take the new version, URL and hash"; git diff; exit 1; }+ git diff+ git config user.name "github-actions[bot]"+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"+ git commit -qam "skykeep $VERSION"+ git push origin HEAD+ echo "bucket: skykeep $old -> $VERSION"++ winget:+ needs: resolve+ if: needs.resolve.outputs.go == 'true'+ runs-on: ubuntu-24.04+ timeout-minutes: 15+ # Komac reads the release with WINGET_TOKEN; this run's own token is not used.+ permissions: {}+ env:+ TAG: ${{ needs.resolve.outputs.tag }}+ VERSION: ${{ needs.resolve.outputs.version }}+ IDENTIFIER: YashwanthKamireddi.Skykeep+ # Komac, pinned to one release and its published checksum rather than a moving action.+ KOMAC_VERSION: 2.17.2+ KOMAC_SHA256: b03b020eec98acfb0b53e284a6e21815b884be33de6785b97e7a120f0e748966+ steps:+ - name: The winget token is there, and winget-pkgs has the package+ 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; }+ - name: Komac+ 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"+ echo "$KOMAC_SHA256 komac.tar.gz" | sha256sum -c -+ mkdir komac && tar -xzf komac.tar.gz -C komac komac+ echo "$RUNNER_TEMP/komac" >> "$GITHUB_PATH"+ # 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+ env:+ GH_TOKEN: ${{ secrets.WINGET_TOKEN }}+ GITHUB_TOKEN: ${{ secrets.WINGET_TOKEN }}+ REPO: ${{ github.repository }}+ run: |+ installers=$(gh release view "$TAG" --repo "$REPO" --json assets \+ --jq '.assets[] | select(.name | test("^Skykeep_[0-9]+\\.[0-9]+\\.[0-9]+_x64-setup\\.exe$")) | .url')+ [ "$(printf '%s\n' "$installers" | grep -c .)" -eq 1 ] \+ || { echo "::error::expected one NSIS installer in $TAG, found: ${installers:-none}"; exit 1; }+ case "$installers" in */"Skykeep_${VERSION}_x64-setup.exe") ;; *) echo "::error::the installer is not $VERSION's: $installers"; exit 1 ;; esac+ # In CI, Komac exits without a new PR when one for this version is already open.+ komac update "$IDENTIFIER" --version "$VERSION" --urls "$installers" \+ --release-notes-url "https://github.com/$REPO/releases/tag/$TAG" --submit++ msix:+ needs: resolve+ if: needs.resolve.outputs.go == 'true'+ permissions:+ contents: read+ uses: ./.github/workflows/msix.yml+ with:+ tag: ${{ needs.resolve.outputs.tag }}+ store: truediff --git a/packaging/README.md b/packaging/README.mdindex 53d7ecf..7e900a3 100644--- a/packaging/README.md+++ b/packaging/README.md@@ -17,6 +17,35 @@ Everything that turns a build into something people install.| `windows/msix/` | The Microsoft Store's MSIX package: its manifest and `pack.ps1`. || `linux-compat/` | `check.sh`: installs a package in a clean distribution container and checks it runs. |+## From a release to every store++`release.yml` builds a tag into a draft release. Publishing it (`gh release edit vX.Y.Z+--draft=false`) starts `.github/workflows/stores.yml`, which skips prereleases and sends the+release to:++- **Snap Store** (stable): `snap.yml`, built from the `.deb`, started, uploaded.+- **Chocolatey**: `packages.yml`, packed, installed, uninstalled, then pushed.+- **Scoop**: `bucket/skykeep.json` in `scoop-bucket` gets the new version, URL and hash,+ checked against the installer itself, and is pushed.+- **winget**: a pull request to `microsoft/winget-pkgs` from the owner's fork, made by Komac+ (pinned release, checksum checked) from the NSIS `-setup.exe` only.+- **Microsoft Store**: `msix.yml` builds the unsigned `.msix` as the `skykeep-msix` artifact of+ the run; upload it to Partner Center by hand. It fails unless the `MSIX_*` repository+ variables are set.+- **COPR** builds each new tag from its own webhook.++Re-run one release: Actions → Stores → Run workflow, with its tag. The secrets it reads:++| Secret | What it is |+|---|---|+| `SNAPCRAFT_STORE_CREDENTIALS` | `snapcraft export-login` output. |+| `CHOCOLATEY_API_KEY` | The community.chocolatey.org API key. |+| `SCOOP_BUCKET_TOKEN` | A fine-grained token: repository access to `scoop-bucket` only, Contents read and write. |+| `WINGET_TOKEN` | A classic token with the `public_repo` scope (Komac cannot open the pull request with a fine-grained one). |++winget only updates a package it already has, so the first version's pull request must be+merged before the winget job can succeed.+## Arch, CachyOS, EndeavourOS, Manjaro```shdiff --git a/packaging/scoop/README.md b/packaging/scoop/README.mdindex 3c24ca6..fd5af16 100644--- a/packaging/scoop/README.md+++ b/packaging/scoop/README.md@@ -41,8 +41,10 @@ scoop bucket add skykeep https://github.com/YashwanthKamireddi/scoop-bucketscoop install skykeep/skykeep```-At each release, on Windows with Scoop, update the manifest from the release and push it (and-copy it back here):+At each published release, `.github/workflows/stores.yml` moves `bucket/skykeep.json` to it+(version, URL and hash) and pushes it, with the `SCOOP_BUCKET_TOKEN` secret (see+[`../README.md`](../README.md#from-a-release-to-every-store)). By hand, on Windows with Scoop,+update the manifest from the release and push it (and copy it back here):```powershell& "$(scoop prefix scoop)\bin\checkver.ps1" -App skykeep -Dir .\bucket -Update