From ba34993eb7756346fc13677125826d6206ec0c8c Mon Sep 17 00:00:00 2001 From: LucDeCaf Date: Thu, 19 Feb 2026 16:49:20 +0200 Subject: [PATCH 01/12] add release note gen + action --- .github/workflows/release.yml | 40 +++++++++++++++++++++++++++++------ Scripts/gen_release_notes.sh | 25 ++++++++++++++++++++++ 2 files changed, 58 insertions(+), 7 deletions(-) create mode 100755 Scripts/gen_release_notes.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9aef395..fa89cf3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,7 @@ jobs: release: name: Release runs-on: macos-latest - if: github.ref == 'refs/heads/main' + # if: github.ref == 'refs/heads/main' steps: - name: Checkout Repository @@ -18,24 +18,25 @@ jobs: - name: Setup .NET SDK uses: actions/setup-dotnet@v4 with: - dotnet-version: '8.0.x' + dotnet-version: "8.0.x" - name: Install MAUI Workloads run: dotnet workload restore - name: Download PowerSync extension - run: dotnet run --project Tools/Setup + run: dotnet run --project Tools/Setup - name: Restore dependencies run: dotnet restore - + - name: Extract Common Package Version from CHANGELOG.md id: extract_version shell: bash run: | VERSION=$(awk '/^## [0-9]+\.[0-9]+\.[0-9]+/ {print $2; exit}' PowerSync/PowerSync.Common/CHANGELOG.md) echo "Detected Version: $VERSION" - echo "VERSION=$VERSION" >> $GITHUB_ENV + echo "VERSION=$VERSION" >> $GITHUB_ENV + echo "COMMON_VERSION=$VERSION" >> $GITHUB_ENV - name: Run Pack for Common run: dotnet pack PowerSync/PowerSync.Common -c Release -o ${{ github.workspace }}/output @@ -51,7 +52,8 @@ jobs: MAUI_VERSION=$(awk '/^## [0-9]+\.[0-9]+\.[0-9]+/ {print $2; exit}' PowerSync/PowerSync.Maui/CHANGELOG.md) echo "Detected Version: $MAUI_VERSION" echo "VERSION=$MAUI_VERSION" >> $GITHUB_ENV - + echo "MAUI_VERSION=$MAUI_VERSION" >> $GITHUB_ENV + - name: Build MAUI Project run: dotnet build PowerSync/PowerSync.Maui -c Release @@ -60,4 +62,28 @@ jobs: - name: Run Push For MAUI continue-on-error: true - run: dotnet nuget push ${{ github.workspace }}/output/PowerSync.Maui*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} \ No newline at end of file + run: dotnet nuget push ${{ github.workspace }}/output/PowerSync.Maui*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} + + - name: Generate Release Notes + shell: bash + run: | + chmod +x ./Scripts/gen_release_notes.sh + ./Scripts/gen_release_notes.sh PowerSync/PowerSync.Common/CHANGELOG.md > /tmp/release_notes_common.md + ./Scripts/gen_release_notes.sh PowerSync/PowerSync.Maui/CHANGELOG.md > /tmp/release_notes_maui.md + + - name: Create GitHub Releases + env: + GH_TOKEN: ${{ github.token }} + run: | + gh release create "PowerSync.Common@${{ env.COMMON_VERSION }}" \ + --title "PowerSync.Common@${{ env.COMMON_VERSION }}" \ + --notes-file /tmp/release_notes_common.md \ + --prerelease \ + --draft \ + ${{ github.workspace }}/output/PowerSync.Common*.nupkg + gh release create "PowerSync.Maui@${{ env.MAUI_VERSION }}" \ + --title "PowerSync.Maui@${{ env.MAUI_VERSION }}" \ + --notes-file /tmp/release_notes_maui.md \ + --prerelease \ + --draft \ + ${{ github.workspace }}/output/PowerSync.Maui*.nupkg diff --git a/Scripts/gen_release_notes.sh b/Scripts/gen_release_notes.sh new file mode 100755 index 0000000..ee41ee7 --- /dev/null +++ b/Scripts/gen_release_notes.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +get_changelog_items() { + awk '/^## /{count++; next} count==1' "$1" | sed '1d;$d' +} + +get_package_name() { + head -n 1 "$1" | awk '{print $2}' +} + +get_package_version() { + grep "\\S" "$1" | sed -n '2p' | awk '{print $2}' +} + +release_notes() { + # Print package name and version + package_name=$(get_package_name "$1") + package_version=$(get_package_version "$1") + printf "# %s v%s\n\n" "$package_name" "$package_version" + + # Print changelog items + get_changelog_items "$1" +} + +release_notes "$1" From ec0a3f93dc0468f941b956209a59bef9f8f998ec Mon Sep 17 00:00:00 2001 From: LucDeCaf Date: Thu, 19 Feb 2026 18:13:34 +0200 Subject: [PATCH 02/12] comment out nuget release for testing --- .github/workflows/release.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fa89cf3..72cc541 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,9 +41,9 @@ jobs: - name: Run Pack for Common run: dotnet pack PowerSync/PowerSync.Common -c Release -o ${{ github.workspace }}/output - - name: Run Push for Common - continue-on-error: true - run: dotnet nuget push ${{ github.workspace }}/output/PowerSync.Common*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} + # - name: Run Push for Common + # continue-on-error: true + # run: dotnet nuget push ${{ github.workspace }}/output/PowerSync.Common*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} - name: Extract MAUI Package Version from CHANGELOG.md id: extract_maui_version @@ -60,9 +60,9 @@ jobs: - name: Run Pack For MAUI run: dotnet pack PowerSync/PowerSync.Maui -c Release -o ${{ github.workspace }}/output - - name: Run Push For MAUI - continue-on-error: true - run: dotnet nuget push ${{ github.workspace }}/output/PowerSync.Maui*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} + # - name: Run Push For MAUI + # continue-on-error: true + # run: dotnet nuget push ${{ github.workspace }}/output/PowerSync.Maui*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} - name: Generate Release Notes shell: bash From 80c8d3a37b72c55c5964d539c53679fea373cc5a Mon Sep 17 00:00:00 2001 From: LucDeCaf Date: Thu, 19 Feb 2026 19:36:49 +0200 Subject: [PATCH 03/12] workflow testing --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 72cc541..962fb35 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,7 +1,7 @@ # The version is pulled from the CHANGELOG.md file of the package. name: Release -on: workflow_dispatch +on: pull_request jobs: release: From d4acf3fdd6edb69fc093902b73272643b49e0902 Mon Sep 17 00:00:00 2001 From: LucDeCaf Date: Thu, 19 Feb 2026 19:48:39 +0200 Subject: [PATCH 04/12] update release notes script --- Scripts/gen_release_notes.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Scripts/gen_release_notes.sh b/Scripts/gen_release_notes.sh index ee41ee7..c09743f 100755 --- a/Scripts/gen_release_notes.sh +++ b/Scripts/gen_release_notes.sh @@ -12,14 +12,21 @@ get_package_version() { grep "\\S" "$1" | sed -n '2p' | awk '{print $2}' } +nuget_link() { + printf "https://www.nuget.org/packages/%s/%s\n" "$1" "$2" +} + release_notes() { - # Print package name and version package_name=$(get_package_name "$1") package_version=$(get_package_version "$1") - printf "# %s v%s\n\n" "$package_name" "$package_version" # Print changelog items + printf "# Changelog\n\n" get_changelog_items "$1" + + # Print package link + printf "\n# Links\n\n" + nuget_link "$package_name" "$package_version" } release_notes "$1" From 99c72e4a615f019f49cd570c8d72d5e420eeb647 Mon Sep 17 00:00:00 2001 From: LucDeCaf Date: Thu, 19 Feb 2026 19:55:45 +0200 Subject: [PATCH 05/12] add commit target --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 962fb35..60f8f6f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -78,12 +78,14 @@ jobs: gh release create "PowerSync.Common@${{ env.COMMON_VERSION }}" \ --title "PowerSync.Common@${{ env.COMMON_VERSION }}" \ --notes-file /tmp/release_notes_common.md \ + --target ${{ github.sha }} \ --prerelease \ --draft \ ${{ github.workspace }}/output/PowerSync.Common*.nupkg gh release create "PowerSync.Maui@${{ env.MAUI_VERSION }}" \ --title "PowerSync.Maui@${{ env.MAUI_VERSION }}" \ --notes-file /tmp/release_notes_maui.md \ + --target ${{ github.sha }} \ --prerelease \ --draft \ ${{ github.workspace }}/output/PowerSync.Maui*.nupkg From ecf0660d80106851bfc0d035a0258e7cb8590d0a Mon Sep 17 00:00:00 2001 From: LucDeCaf Date: Thu, 19 Feb 2026 20:08:50 +0200 Subject: [PATCH 06/12] test generated release notes --- .github/workflows/release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 60f8f6f..49a2634 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -77,15 +77,15 @@ jobs: run: | gh release create "PowerSync.Common@${{ env.COMMON_VERSION }}" \ --title "PowerSync.Common@${{ env.COMMON_VERSION }}" \ - --notes-file /tmp/release_notes_common.md \ - --target ${{ github.sha }} \ + --target main + --generate-notes \ --prerelease \ --draft \ ${{ github.workspace }}/output/PowerSync.Common*.nupkg gh release create "PowerSync.Maui@${{ env.MAUI_VERSION }}" \ --title "PowerSync.Maui@${{ env.MAUI_VERSION }}" \ - --notes-file /tmp/release_notes_maui.md \ - --target ${{ github.sha }} \ + --target main + --generate-notes \ --prerelease \ --draft \ ${{ github.workspace }}/output/PowerSync.Maui*.nupkg From c6ad15633d10bc4fbe8bcaaae9531c6e50c4d2f7 Mon Sep 17 00:00:00 2001 From: LucDeCaf Date: Thu, 19 Feb 2026 20:16:40 +0200 Subject: [PATCH 07/12] fix --- .github/workflows/release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 49a2634..042b8a5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -76,16 +76,16 @@ jobs: GH_TOKEN: ${{ github.token }} run: | gh release create "PowerSync.Common@${{ env.COMMON_VERSION }}" \ + --prerelease \ + --draft \ --title "PowerSync.Common@${{ env.COMMON_VERSION }}" \ --target main --generate-notes \ - --prerelease \ - --draft \ ${{ github.workspace }}/output/PowerSync.Common*.nupkg gh release create "PowerSync.Maui@${{ env.MAUI_VERSION }}" \ + --prerelease \ + --draft \ --title "PowerSync.Maui@${{ env.MAUI_VERSION }}" \ --target main --generate-notes \ - --prerelease \ - --draft \ ${{ github.workspace }}/output/PowerSync.Maui*.nupkg From 67b67ac1f212cb95c7ea36f91c686766c818a96f Mon Sep 17 00:00:00 2001 From: LucDeCaf Date: Thu, 19 Feb 2026 20:19:15 +0200 Subject: [PATCH 08/12] actual fix --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 042b8a5..54a9eaf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -79,13 +79,13 @@ jobs: --prerelease \ --draft \ --title "PowerSync.Common@${{ env.COMMON_VERSION }}" \ - --target main + --target main \ --generate-notes \ ${{ github.workspace }}/output/PowerSync.Common*.nupkg gh release create "PowerSync.Maui@${{ env.MAUI_VERSION }}" \ --prerelease \ --draft \ --title "PowerSync.Maui@${{ env.MAUI_VERSION }}" \ - --target main + --target main \ --generate-notes \ ${{ github.workspace }}/output/PowerSync.Maui*.nupkg From 34c7dda6a4efd633fcc501320ed891c680dd86a1 Mon Sep 17 00:00:00 2001 From: LucDeCaf Date: Thu, 19 Feb 2026 20:24:46 +0200 Subject: [PATCH 09/12] prepare for merging --- .github/workflows/release.yml | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 54a9eaf..6a948be 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,13 +1,13 @@ # The version is pulled from the CHANGELOG.md file of the package. name: Release -on: pull_request +on: workflow_dispatch jobs: release: name: Release runs-on: macos-latest - # if: github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/main' steps: - name: Checkout Repository @@ -41,9 +41,9 @@ jobs: - name: Run Pack for Common run: dotnet pack PowerSync/PowerSync.Common -c Release -o ${{ github.workspace }}/output - # - name: Run Push for Common - # continue-on-error: true - # run: dotnet nuget push ${{ github.workspace }}/output/PowerSync.Common*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} + - name: Run Push for Common + continue-on-error: true + run: dotnet nuget push ${{ github.workspace }}/output/PowerSync.Common*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} - name: Extract MAUI Package Version from CHANGELOG.md id: extract_maui_version @@ -60,16 +60,9 @@ jobs: - name: Run Pack For MAUI run: dotnet pack PowerSync/PowerSync.Maui -c Release -o ${{ github.workspace }}/output - # - name: Run Push For MAUI - # continue-on-error: true - # run: dotnet nuget push ${{ github.workspace }}/output/PowerSync.Maui*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} - - - name: Generate Release Notes - shell: bash - run: | - chmod +x ./Scripts/gen_release_notes.sh - ./Scripts/gen_release_notes.sh PowerSync/PowerSync.Common/CHANGELOG.md > /tmp/release_notes_common.md - ./Scripts/gen_release_notes.sh PowerSync/PowerSync.Maui/CHANGELOG.md > /tmp/release_notes_maui.md + - name: Run Push For MAUI + continue-on-error: true + run: dotnet nuget push ${{ github.workspace }}/output/PowerSync.Maui*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} - name: Create GitHub Releases env: From c6844da35794ea6e9deb520ad0dc954318ad8b59 Mon Sep 17 00:00:00 2001 From: LucDeCaf Date: Thu, 19 Feb 2026 20:28:53 +0200 Subject: [PATCH 10/12] make releases not draft --- .github/workflows/release.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6a948be..0cf069f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -70,14 +70,12 @@ jobs: run: | gh release create "PowerSync.Common@${{ env.COMMON_VERSION }}" \ --prerelease \ - --draft \ --title "PowerSync.Common@${{ env.COMMON_VERSION }}" \ --target main \ --generate-notes \ ${{ github.workspace }}/output/PowerSync.Common*.nupkg gh release create "PowerSync.Maui@${{ env.MAUI_VERSION }}" \ --prerelease \ - --draft \ --title "PowerSync.Maui@${{ env.MAUI_VERSION }}" \ --target main \ --generate-notes \ From 38165d501e52323cb9261f9bd7e9de99421bed4c Mon Sep 17 00:00:00 2001 From: LucDeCaf Date: Thu, 19 Feb 2026 20:29:52 +0200 Subject: [PATCH 11/12] remove unused Scripts folder --- Scripts/gen_release_notes.sh | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100755 Scripts/gen_release_notes.sh diff --git a/Scripts/gen_release_notes.sh b/Scripts/gen_release_notes.sh deleted file mode 100755 index c09743f..0000000 --- a/Scripts/gen_release_notes.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash - -get_changelog_items() { - awk '/^## /{count++; next} count==1' "$1" | sed '1d;$d' -} - -get_package_name() { - head -n 1 "$1" | awk '{print $2}' -} - -get_package_version() { - grep "\\S" "$1" | sed -n '2p' | awk '{print $2}' -} - -nuget_link() { - printf "https://www.nuget.org/packages/%s/%s\n" "$1" "$2" -} - -release_notes() { - package_name=$(get_package_name "$1") - package_version=$(get_package_version "$1") - - # Print changelog items - printf "# Changelog\n\n" - get_changelog_items "$1" - - # Print package link - printf "\n# Links\n\n" - nuget_link "$package_name" "$package_version" -} - -release_notes "$1" From cade2b930bb21e53b49e1f55ae13bcd2baff3887 Mon Sep 17 00:00:00 2001 From: LucDeCaf Date: Thu, 19 Feb 2026 20:32:17 +0200 Subject: [PATCH 12/12] remove redundancy --- .github/workflows/release.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0cf069f..e86454f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,7 +35,6 @@ jobs: run: | VERSION=$(awk '/^## [0-9]+\.[0-9]+\.[0-9]+/ {print $2; exit}' PowerSync/PowerSync.Common/CHANGELOG.md) echo "Detected Version: $VERSION" - echo "VERSION=$VERSION" >> $GITHUB_ENV echo "COMMON_VERSION=$VERSION" >> $GITHUB_ENV - name: Run Pack for Common @@ -51,7 +50,6 @@ jobs: run: | MAUI_VERSION=$(awk '/^## [0-9]+\.[0-9]+\.[0-9]+/ {print $2; exit}' PowerSync/PowerSync.Maui/CHANGELOG.md) echo "Detected Version: $MAUI_VERSION" - echo "VERSION=$MAUI_VERSION" >> $GITHUB_ENV echo "MAUI_VERSION=$MAUI_VERSION" >> $GITHUB_ENV - name: Build MAUI Project