-
Notifications
You must be signed in to change notification settings - Fork 7
71 lines (57 loc) · 2.61 KB
/
Copy pathdev-packages.yml
File metadata and controls
71 lines (57 loc) · 2.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# 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
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 from CHANGELOG.md
id: extract_version
shell: bash
run: |
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
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
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
shell: bash
run: |
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
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
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 }}