-
Notifications
You must be signed in to change notification settings - Fork 23
113 lines (102 loc) · 3.56 KB
/
Copy pathdeploy.yml
File metadata and controls
113 lines (102 loc) · 3.56 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Release
on: workflow_dispatch
jobs:
fetch_prebuilts:
uses: ./.github/workflows/prebuild_assets.yml
draft_release:
permissions:
contents: write
name: Create Draft Release on GitHub
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.tag.outputs.tag }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set tag name
id: tag
run: |
tag=$(basename "${{ github.ref }}")
echo "tag=$tag" >> $GITHUB_OUTPUT
- name: Create Release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
tag="${{ steps.tag.outputs.tag }}"
body="Pending release for XCFramework, $tag"
gh release create --draft "$tag" --title "$tag" --notes "$body"
maven_publish:
runs-on: macos-latest
needs:
- fetch_prebuilts
steps:
- uses: actions/checkout@v6
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- uses: actions/cache@v5
with:
path: ~/.konan
key: ${{ runner.os }}-${{ hashFiles('**/.lock') }}
- name: Set up JDK 25
uses: actions/setup-java@v5
with:
java-version: '25'
distribution: 'temurin'
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v6
- name: Download prebuilts
uses: actions/download-artifact@v8
with:
artifact-ids: ${{ needs.fetch_prebuilts.outputs.artifact_id }}
path: internal/prebuild-binaries/build/output/
- name: Generate publications
run: |
./gradlew \
--no-configuration-cache \
-PhasPrebuiltAssets=true \
-PsigningInMemoryKey="${{ secrets.SIGNING_KEY }}" \
-PsigningInMemoryKeyId="${{ secrets.SIGNING_KEY_ID }}" \
-PsigningInMemoryKeyPassword="${{ secrets.SIGNING_PASSWORD }}" \
-Ppowersync.binaries.allPlatforms="true" \
generatePublishingBundle
- name: Inspect publication
run: |
./internal/analyze-bundle.py
zip -r build/sonatypeBundle.zip build/sonatypeBundle/
- name: Upload to Maven Central
env:
# printf "$SONATYPE_USERNAME:$SONATYPE_PASSWORD" | base64
SONATYPE_CREDENTIALS: ${{ secrets.SONATYPE_CREDENTIALS }}
run: |
tag=$(basename "${{ github.ref }}")
curl --fail-with-body --request POST \
--header "Authorization: Bearer $SONATYPE_CREDENTIALS" \
--form bundle=@build/sonatypeBundle.zip \
"https://central.sonatype.com/api/v1/publisher/upload?name=$tag&publishingType=AUTOMATIC"
add_assets:
permissions:
contents: write
needs: [draft_release, fetch_prebuilts]
name: Add assets to pending release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Download prebuilts
uses: actions/download-artifact@v8
with:
artifact-ids: ${{ needs.fetch_prebuilts.outputs.artifact_id }}
path: internal/prebuild-binaries/build/output/
- name: Archive prebuilts
run: |
find internal/prebuild-binaries/build/output
zip -r prebuilt_libraries.zip internal/prebuild-binaries/build/output/
- name: Upload prebuilt libraries
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
gh release upload "${{ needs.draft_release.outputs.tag }}" prebuilt_libraries.zip