Skip to content

Create Dev Release

Create Dev Release #3

Workflow file for this run

# The version is pulled from the CHANGELOG.md file of the package.
# Add a `-dev.xxx` suffix to the version. Example: `0.0.1-dev.1`
name: Create Dev Release
on:
workflow_dispatch:
inputs:
version:
description: "Package version override."
required: false
type: string
permissions:
contents: read
packages: write
jobs:
dev-release:
name: Publish Dev Packages
runs-on: macos-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"
- name: Install MAUI Workloads
run: dotnet workload restore
- name: Download PowerSync extension
run: dotnet run --project Tools/Setup
- name: Restore dependencies
run: dotnet restore
- name: Extract Common Package Version
id: extract_version
shell: bash
run: |
if [[ -n "${{ inputs.version }}" ]]; then
COMMON_VERSION="${{ inputs.version }}"
else
COMMON_VERSION=$(awk '/^## [0-9]+\.[0-9]+\.[0-9]+-dev(\.[0-9]+)?$/ {print $2; exit}' PowerSync/PowerSync.Common/CHANGELOG.md)
if [[ -z "$COMMON_VERSION" ]]; then
echo "Error: Invalid dev version found in PowerSync.Common/CHANGELOG.md. Expected format: x.x.x-dev.x"
exit 1
fi
fi
echo "Detected Version: $COMMON_VERSION"
echo "VERSION=$COMMON_VERSION" >> $GITHUB_ENV
- name: Run Pack For Common
run: dotnet pack PowerSync/PowerSync.Common -c Release -o ${{ github.workspace }}/output
- name: Run Push For Common
run: dotnet nuget push ${{ github.workspace }}/output/PowerSync.Common*.nupkg --source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate
- name: Extract MAUI Package Version
id: extract_maui_version
shell: bash
run: |
if [[ -n "${{ inputs.version }}" ]]; then
MAUI_VERSION="${{ inputs.version }}"
else
MAUI_VERSION=$(awk '/^## [0-9]+\.[0-9]+\.[0-9]+-dev(\.[0-9]+)?$/ {print $2; exit}' PowerSync/PowerSync.Maui/CHANGELOG.md)
if [[ -z "$MAUI_VERSION" ]]; then
echo "Error: Invalid dev version found in PowerSync.Maui/CHANGELOG.md. Expected format: x.x.x-dev.x"
exit 1
fi
fi
echo "Detected Version: $MAUI_VERSION"
echo "VERSION=$MAUI_VERSION" >> $GITHUB_ENV
- name: Build MAUI Project
run: dotnet build PowerSync/PowerSync.Maui -c Release
- name: Run Pack For MAUI
run: dotnet pack PowerSync/PowerSync.Maui -c Release -o ${{ github.workspace }}/output
- name: Run Push For MAUI
run: dotnet nuget push ${{ github.workspace }}/output/PowerSync.Maui*.nupkg --source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate