Skip to content

Commit 66cfead

Browse files
authored
Merge pull request #302 from reown-com/fix/release-pipeline-tag-and-publishing
fix: use gh API for tag creation and fix automatic publishing
2 parents fc5d265 + 56ad7ed commit 66cfead

File tree

2 files changed

+11
-18
lines changed

2 files changed

+11
-18
lines changed

.github/workflows/ci_release_artifacts.yml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -96,23 +96,19 @@ jobs:
9696
echo "bom_version=$VERSION" >> "$GITHUB_OUTPUT"
9797
echo "Extracted BOM version: $VERSION"
9898
99-
- name: Create git tag
99+
- name: Create git tag and GitHub Release
100+
env:
101+
GH_TOKEN: ${{ secrets.PUSH_GITHUB_TOKEN }}
100102
run: |
101-
git config user.name "github-actions[bot]"
102-
git config user.email "github-actions[bot]@users.noreply.github.com"
103103
TAG="BOM_${{ steps.version.outputs.bom_version }}"
104-
if git rev-parse "$TAG" >/dev/null 2>&1; then
104+
if gh api repos/${{ github.repository }}/git/refs/tags/$TAG >/dev/null 2>&1; then
105105
echo "Tag $TAG already exists, skipping tag creation"
106106
else
107-
git tag "$TAG"
108-
git push origin "$TAG"
107+
gh api repos/${{ github.repository }}/git/refs \
108+
-f ref="refs/tags/$TAG" \
109+
-f sha="${{ github.sha }}"
109110
fi
110-
111-
- name: Create GitHub Release
112-
env:
113-
GH_TOKEN: ${{ secrets.PUSH_GITHUB_TOKEN }}
114-
run: |
115-
gh release create "BOM_${{ steps.version.outputs.bom_version }}" \
111+
gh release create "$TAG" \
116112
--target master \
117-
--title "BOM_${{ steps.version.outputs.bom_version }}" \
113+
--title "$TAG" \
118114
--generate-notes

build.gradle.kts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ tasks.register("closeAndReleaseMultipleRepositories") {
147147
}
148148

149149
println("Starting to wait for artifacts to be available on Maven Central...")
150-
// Wait for artifacts to be available on Maven Central since we're using automatic publishing
151150
waitForArtifactsToBeAvailable()
152151
println("closeAndReleaseMultipleRepositories task completed successfully!")
153152
}
@@ -249,7 +248,7 @@ fun uploadRepositoriesToPortal(repositories: List<StagingRepository>) {
249248
}
250249

251250
fun uploadRepositoryToPortal(repositoryKey: String, maxRetries: Int = 3) {
252-
val uploadUrl = "$manualApiUrl/upload/repository/$repositoryKey"
251+
val uploadUrl = "$manualApiUrl/upload/repository/$repositoryKey?publishing_type=automatic"
253252
println("Starting upload for repository: $repositoryKey")
254253
println("Upload URL: $uploadUrl")
255254

@@ -260,8 +259,6 @@ fun uploadRepositoryToPortal(repositoryKey: String, maxRetries: Int = 3) {
260259
try {
261260
val httpPost = HttpPost(uploadUrl).apply {
262261
setHeader("Authorization", authHeader())
263-
setHeader("Content-Type", "application/json")
264-
entity = StringEntity("""{"publishing_type": "automatic"}""")
265262
}
266263

267264
println("Executing HTTP POST request (attempt ${attempt + 1}/$maxRetries)...")
@@ -400,4 +397,4 @@ private val artifactsToCheck = listOf(
400397
ArtifactCheck("com/reown", MODAL_CORE, MODAL_CORE_VERSION),
401398
ArtifactCheck("com/walletconnect", PAY, PAY_VERSION),
402399
ArtifactCheck("com/walletconnect", POS, POS_VERSION),
403-
)
400+
)

0 commit comments

Comments
 (0)