Skip to content

Commit 43b31a1

Browse files
committed
Set merge-multiple
1 parent 9fe1906 commit 43b31a1

File tree

2 files changed

+95
-9
lines changed

2 files changed

+95
-9
lines changed

.github/workflows/deploy-swit.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,17 @@ jobs:
7979
with:
8080
fetch-depth: 0
8181
- uses: actions/download-artifact@v4
82+
with:
83+
merge-multiple: true
84+
- run: "ls -al"
8285
- name: Upload XCFramework
8386
env:
8487
GH_TOKEN: ${{ github.token }}
8588
GH_REPO: ${{ github.repository }}
8689
run: |
8790
gh release upload "${{ needs.draft_release.outputs.tag }}" PowersyncKotlinRelease.zip
8891
89-
- name: "Update checksum"
92+
- name: "Update release description"
9093
shell: zsh
9194
run: |
9295
checksums=$(sha256sum PowersyncKotlinRelease.zip)

.github/workflows/deploy.yml

+91-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,35 @@
1-
name: Deploy to Sonatype
1+
name: Release
22

33
on: workflow_dispatch
44

5-
permissions:
6-
contents: read
7-
85
jobs:
9-
test:
10-
uses: ./.github/workflows/test.yml
11-
deploy:
12-
needs: [test]
6+
draft_release:
7+
permissions:
8+
contents: write
9+
name: Create Draft Release on GitHub
10+
runs-on: ubuntu-latest
11+
outputs:
12+
tag: ${{ steps.tag.outputs.tag }}
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Set tag name
19+
id: tag
20+
run: |
21+
tag=$(basename "${{ github.ref }}")
22+
echo "tag=$tag" >> $GITHUB_OUTPUT
23+
- name: Create Release
24+
env:
25+
GH_TOKEN: ${{ github.token }}
26+
GH_REPO: ${{ github.repository }}
27+
run: |
28+
tag="${{ steps.tag.outputs.tag }}"
29+
body="Pending release for XCFramework, $tag"
30+
gh release create --draft "$tag" --title "$tag" --notes "$body"
31+
32+
maven_publish:
1333
runs-on: macos-latest
1434
steps:
1535
- uses: actions/checkout@v4
@@ -38,3 +58,66 @@ jobs:
3858
-Ppowersync.binaries.allPlatforms="true" \
3959
publishAllPublicationsToSonatypeRepository
4060
shell: bash
61+
62+
build_xcframeworks:
63+
name: Build XCFrameworks
64+
runs-on: macos-latest
65+
steps:
66+
- uses: actions/checkout@v4
67+
- name: Validate Gradle Wrapper
68+
uses: gradle/wrapper-validation-action@v1
69+
- uses: actions/cache@v3
70+
with:
71+
path: ~/.konan
72+
key: ${{ runner.os }}-${{ hashFiles('**/.lock') }}
73+
- name: Set up JDK 17
74+
uses: actions/setup-java@v3
75+
with:
76+
java-version: '17'
77+
distribution: 'temurin'
78+
- name: Set up Gradle
79+
uses: gradle/actions/setup-gradle@v4
80+
- name: Build frameworks
81+
run: "./gradlew PowerSyncKotlin:buildRelease"
82+
83+
- uses: actions/upload-artifact@v4
84+
with:
85+
name: XCFramework
86+
retention-days: 1 # Only used temporarily
87+
compression-level: 0 # We're already uploading a compressed file
88+
path: PowerSyncKotlin/build/FrameworkArchives/PowersyncKotlinRelease.zip
89+
if-no-files-found: error
90+
91+
add_assets:
92+
permissions:
93+
contents: write
94+
needs: [draft_release, build_xcframeworks]
95+
name: Add assets to pending release
96+
runs-on: ubuntu-latest
97+
steps:
98+
- uses: actions/checkout@v4
99+
with:
100+
fetch-depth: 0
101+
- uses: actions/download-artifact@v4
102+
with:
103+
merge-multiple: true
104+
- run: "ls -al"
105+
- name: Upload XCFramework
106+
env:
107+
GH_TOKEN: ${{ github.token }}
108+
GH_REPO: ${{ github.repository }}
109+
run: |
110+
gh release upload "${{ needs.draft_release.outputs.tag }}" PowersyncKotlinRelease.zip
111+
112+
- name: "Update release description"
113+
shell: zsh
114+
run: |
115+
checksums=$(sha256sum PowersyncKotlinRelease.zip)
116+
cat > RELEASE_NOTES <<- NOTES_END
117+
File hashes:
118+
\`\`\`
119+
$checksums
120+
\`\`\`
121+
NOTES_END
122+
123+
gh release edit "${{ needs.draft_release.outputs.tag }}" -F RELEASE_NOTES

0 commit comments

Comments
 (0)