44 tags :
55 - v[0-9]+.[0-9]+.[0-9]+
66
7+ permissions : {}
8+
79jobs :
810 draft_release :
911 name : Create Draft GitHub Release
1012 runs-on : ubuntu-latest
1113 outputs :
1214 tag : ${{ steps.tag.outputs.tag }}
15+ permissions :
16+ contents : write # Needed to create a release
1317 steps :
14- - uses : actions/checkout@v3
18+ - uses : actions/checkout@v6
1519 with :
20+ persist-credentials : false
1621 fetch-depth : 0
1722
1823 - name : Set tag name
1924 id : tag
2025 run : |
21- tag=$(basename "${{ github.ref } }")
26+ tag=$(basename "${GITHUB_REF }")
2227 echo "tag=$tag" >> $GITHUB_OUTPUT
2328 - name : Create Release
2429 env :
2530 GH_TOKEN : ${{ github.token }}
2631 GH_REPO : ${{ github.repository }}
32+ STEPS_TAG_OUTPUTS_TAG : ${{ steps.tag.outputs.tag }}
2733 run : |
28- tag="${{ steps.tag.outputs.tag } }"
34+ tag="${STEPS_TAG_OUTPUTS_TAG }"
2935 body="Release $tag"
3036 gh release create --draft "$tag" --title "$tag" --notes "$body"
3137
3238 libs_linux :
3339 name : Building Linux libraries
3440 runs-on : ubuntu-latest
3541 steps :
36- - uses : actions/checkout@v4
42+ - uses : actions/checkout@v6
43+ with :
44+ persist-credentials : false
3745 - name : Build Linux
3846 uses : ./.github/actions/linux
3947
4048 libs_macos :
4149 name : Building macOS libraries
4250 runs-on : macos-latest
4351 steps :
44- - uses : actions/checkout@v4
52+ - uses : actions/checkout@v6
53+ with :
54+ persist-credentials : false
4555 - name : Build macOS
4656 uses : ./.github/actions/macos
4757
4858 libs_windows :
4959 name : Building Windows libraries
5060 runs-on : windows-latest
5161 steps :
52- - uses : actions/checkout@v4
62+ - uses : actions/checkout@v6
63+ with :
64+ persist-credentials : false
5365 - name : Build Windows
5466 uses : ./.github/actions/windows
5567
5668 libs_android :
5769 name : Building Android libraries
5870 runs-on : ubuntu-latest
5971 steps :
60- - uses : actions/checkout@v4
72+ - uses : actions/checkout@v6
73+ with :
74+ persist-credentials : false
6175 - name : Build Android
6276 uses : ./.github/actions/android
6377 with :
6882 name : Basic WASM build
6983 runs-on : ubuntu-latest
7084 steps :
71- - uses : actions/checkout@v4
85+ - uses : actions/checkout@v6
86+ with :
87+ persist-credentials : false
7288
7389 - name : Build wasm
7490 uses : ./.github/actions/wasm
@@ -77,28 +93,31 @@ jobs:
7793 name : Build XCFramework
7894 runs-on : macos-latest
7995 steps :
80- - uses : actions/checkout@v4
96+ - uses : actions/checkout@v6
97+ with :
98+ persist-credentials : false
8199 - name : Build XCFramework
82100 uses : ./.github/actions/xcframework
83101
84102 publish_android :
85- permissions :
86- contents : read
87- packages : write
88103 name : Publish Android
89104 needs : [ draft_release, libs_android ]
90105 runs-on : ubuntu-latest
91106 steps :
92- - uses : actions/checkout@v4
107+ - uses : actions/checkout@v6
108+ with :
109+ persist-credentials : false
93110
94111 - uses : actions/download-artifact@v4
95112 with :
96113 name : android-library
97114
98115 - name : Publish to Maven Central
116+ env :
117+ AUTH_TOKEN : ${{ secrets.CENTRAL_AUTH }}
99118 run : |
100119 curl --request POST \
101- --header ' Authorization: Bearer ${{ secrets.CENTRAL_AUTH }}' \
120+ --header " Authorization: Bearer $AUTH_TOKEN" \
102121 --form bundle=@powersync_android.zip \
103122 'https://central.sonatype.com/api/v1/publisher/upload?publishingType=AUTOMATIC'
104123
@@ -107,7 +126,9 @@ jobs:
107126 needs : [ draft_release, libs_xcframework ]
108127 runs-on : macos-latest
109128 steps :
110- - uses : actions/checkout@v4
129+ - uses : actions/checkout@v6
130+ with :
131+ persist-credentials : false
111132
112133 - name : Download libs
113134 uses : actions/download-artifact@v5
@@ -132,17 +153,21 @@ jobs:
132153 env :
133154 GH_TOKEN : ${{ github.token }}
134155 GH_REPO : ${{ github.repository }}
156+ NEEDS_DRAFT_RELEASE_OUTPUTS_TAG : ${{ needs.draft_release.outputs.tag }}
157+ STEPS_FILENAME_OUTPUTS_FILENAME : ${{ steps.fileName.outputs.fileName }}
135158 run : |
136- gh release upload "${{ needs.draft_release.outputs.tag }} " ${{ steps.fileName.outputs.fileName } }
159+ gh release upload "${NEEDS_DRAFT_RELEASE_OUTPUTS_TAG} " ${STEPS_FILENAME_OUTPUTS_FILENAME }
137160
138161 # For SPM package
139162 - name : Generate and add checksum to output
140163 id : checksum
141164 run : |
142- CHECKSUM=$(swift package compute-checksum ${{ steps.fileName.outputs.fileName } })
165+ CHECKSUM=$(swift package compute-checksum ${STEPS_FILENAME_OUTPUTS_FILENAME })
143166 echo "checksum=$CHECKSUM" >> $GITHUB_OUTPUT
167+ env :
168+ STEPS_FILENAME_OUTPUTS_FILENAME : ${{ steps.fileName.outputs.fileName }}
144169 - name : Dispatch release to SPM package
145- uses : peter-evans/repository-dispatch@v3
170+ uses : peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4.0.1
146171 with :
147172 token : ${{ secrets.SWIFT_PUBLISH_TOKEN }}
148173 repository : powersync-ja/powersync-sqlite-core-swift
@@ -160,9 +185,13 @@ jobs:
160185 name : Publish Desktop libraries
161186 needs : [ draft_release, libs_linux, libs_macos, libs_windows ]
162187 runs-on : ubuntu-latest
188+ permissions :
189+ contents : write # Needed to upload binaries to release.
163190
164191 steps :
165- - uses : actions/checkout@v4
192+ - uses : actions/checkout@v6
193+ with :
194+ persist-credentials : false
166195
167196 - name : Download Linux libraries
168197 uses : actions/download-artifact@v5
@@ -195,51 +224,45 @@ jobs:
195224 env :
196225 GH_TOKEN : ${{ github.token }}
197226 GH_REPO : ${{ github.repository }}
227+ TAG : ${{ needs.draft_release.outputs.tag }}
198228 run : |
199- gh release upload "${{ needs.draft_release.outputs.tag } }" *.dll
200- gh release upload "${{ needs.draft_release.outputs.tag } }" *.dylib
201- gh release upload "${{ needs.draft_release.outputs.tag } }" *.so
202- gh release upload "${{ needs.draft_release.outputs.tag } }" static_libs.zip
229+ gh release upload "${TAG }" *.dll
230+ gh release upload "${TAG }" *.dylib
231+ gh release upload "${TAG }" *.so
232+ gh release upload "${TAG }" static_libs.zip
203233
204234 publish_wasm :
205235 name : Publish WASM builds
206236 needs : [ draft_release, libs_wasm ]
207237 runs-on : ubuntu-latest
238+ permissions :
239+ contents : write # Needed to upload binaries to release.
208240 steps :
209- - uses : actions/checkout@v4
241+ - uses : actions/checkout@v6
242+ with :
243+ persist-credentials : false
210244
211245 - name : Download wasm bundle
212246 uses : actions/download-artifact@v5
213247 with :
214248 name : wasm-library
215249
216- - name : Upload libpowersync.wasm
217- uses : ./.github/actions/upload
218- with :
219- repo-token : ${{ secrets.GITHUB_TOKEN }}
220- file-name : libpowersync.wasm
221- tag : ${{ needs.draft_release.outputs.tag }}
222-
223- - name : Upload libpowersync-async.wasm
224- uses : ./.github/actions/upload
225- with :
226- repo-token : ${{ secrets.GITHUB_TOKEN }}
227- file-name : libpowersync-async.wasm
228- tag : ${{ needs.draft_release.outputs.tag }}
229-
230- - name : Upload libpowersync-wasm.a
231- uses : ./.github/actions/upload
232- with :
233- repo-token : ${{ secrets.GITHUB_TOKEN }}
234- file-name : libpowersync-wasm.a
235- tag : ${{ needs.draft_release.outputs.tag }}
250+ - name : Upload wasm binaries
251+ env :
252+ GH_TOKEN : ${{ github.token }}
253+ GH_REPO : ${{ github.repository }}
254+ TAG : ${{ needs.draft_release.outputs.tag }}
255+ run : |
256+ gh release upload "${TAG}" libpowersync-wasm.a
236257
237258 publish_crates_io :
238259 runs-on : ubuntu-latest
239260 permissions :
240261 id-token : write # Required for OIDC token exchange
241262 steps :
242- - uses : actions/checkout@v5
263+ - uses : actions/checkout@v6
264+ with :
265+ persist-credentials : false
243266 - uses : rust-lang/crates-io-auth-action@v1
244267 id : auth
245268
@@ -257,7 +280,7 @@ jobs:
257280 create_sdk_issue :
258281 name : " Create issue for SDK updates"
259282 permissions :
260- issues : write
283+ issues : write # To create issue
261284 runs-on : macos-latest
262285 needs :
263286 - draft_release
0 commit comments