diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9aef395..e86454f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,24 +18,24 @@ 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 "COMMON_VERSION=$VERSION" >> $GITHUB_ENV - name: Run Pack for Common run: dotnet pack PowerSync/PowerSync.Common -c Release -o ${{ github.workspace }}/output @@ -50,8 +50,8 @@ 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 run: dotnet build PowerSync/PowerSync.Maui -c Release @@ -60,4 +60,21 @@ 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: Create GitHub Releases + env: + GH_TOKEN: ${{ github.token }} + run: | + gh release create "PowerSync.Common@${{ env.COMMON_VERSION }}" \ + --prerelease \ + --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 \ + --title "PowerSync.Maui@${{ env.MAUI_VERSION }}" \ + --target main \ + --generate-notes \ + ${{ github.workspace }}/output/PowerSync.Maui*.nupkg