Skip to content

Commit 161ac91

Browse files
kingsleyadiofacebook-github-bot
authored andcommitted
Migrate to central publishing (#1069)
Summary: Context: We are migrating from Legacy OSSRH to Central Portal (Maven Central) https://fb.workplace.com/groups/osssupport/posts/28470912815863963 Guide: https://central.sonatype.org/publish/publish-portal-ossrh-staging-api/ Plugin release notes: https://github.com/vanniktech/gradle-maven-publish-plugin/releases/tag/0.34.0 Reviewed By: pengj Differential Revision: D78742539
1 parent 55e28e5 commit 161ac91

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ jobs:
9898
deploy-check:
9999
name: Skip deploy if PR or Fork or not a SNAPSHOT version
100100
needs: [build, tests]
101-
if: ${{ github.event_name != 'pull_request' && github.repository == 'facebook/litho' }}
101+
if: ${{ github.repository == 'facebook/litho' }}
102102
runs-on: ubuntu-latest
103103
outputs:
104104
is-snapshot: ${{ steps.check_snapshot.outputs.IS_SNAPSHOT != '' }}
@@ -108,7 +108,7 @@ jobs:
108108
- name: Check if SNAPSHOT version
109109
id: check_snapshot
110110
run: |
111-
echo "IS_SNAPSHOT=`grep 'VERSION_NAME=[0-9\.]\+-SNAPSHOT' gradle.properties)`" >> $GITHUB_OUTPUT
111+
echo "IS_SNAPSHOT=`grep 'VERSION_NAME=[0-9\.]\+-SNAPSHOT' gradle.properties`" >> $GITHUB_OUTPUT
112112
deploy:
113113
needs: [deploy-check]
114114
if: ${{ needs.deploy-check.outputs.is-snapshot == 'true' }}
@@ -134,6 +134,10 @@ jobs:
134134
uses: actions/setup-python@v4
135135
with:
136136
python-version: '3.9.16'
137+
- name: Setup Android SDK
138+
uses: android-actions/setup-android@v3
139+
- name: Install CMake
140+
run: sdkmanager 'cmake;3.18.1'
137141
- name: Gradle caches
138142
uses: actions/cache@v3
139143
with:
@@ -151,5 +155,12 @@ jobs:
151155
mv buck-v2022.05.05.01-java11.pex buck/buck && \
152156
chmod +x buck/buck && \
153157
ls -l buck)
158+
- name: Write GPG Sec Ring
159+
run: echo '${{ secrets.GPG_KEY_CONTENTS }}' | base64 -d > /tmp/secring.gpg
160+
- name: Update gradle.properties
161+
run: echo -e "signing.secretKeyRingFile=/tmp/secring.gpg\nsigning.keyId=${{ secrets.SIGNING_KEY_ID }}\nsigning.password=${{ secrets.SIGNING_PASSWORD }}\nmavenCentralPassword=${{ secrets.SONATYPE_NEXUS_PASSWORD }}\nmavenCentralUsername=${{ secrets.SONATYPE_NEXUS_USERNAME }}" >> gradle.properties
154162
- name: Publish Snapshot
155-
run: BUCK_PATH=`realpath buck/buck` ./gradlew uploadArchives --stacktrace
163+
run: BUCK_PATH=`realpath buck/buck` ./gradlew publishToMavenCentral --stacktrace
164+
- name: Clean secrets
165+
if: always()
166+
run: rm /tmp/secring.gpg

gradle.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ VERSION_NAME=0.51.0-SNAPSHOT
1818
GROUP=com.facebook.litho
1919

2020
SONATYPE_STAGING_PROFILE=comfacebook
21-
SONATYPE_HOST=DEFAULT
22-
RELEASE_SIGNING_ENABLED=true
21+
mavenCentralPublishing=true
22+
signAllPublications=true
2323

2424
POM_URL=https://github.com/facebook/litho
2525
POM_SCM_URL=https://github.com/facebook/litho.git
@@ -38,7 +38,7 @@ DOKKA_VERSION=1.9.20
3838
DATA_CLASS_GENERATE_VERSION=1.0.1
3939

4040
# Deps for publishing
41-
MAVEN_PUBLISH_PLUGIN=0.29.0
41+
MAVEN_PUBLISH_PLUGIN=0.34.0
4242

4343
# Gradle internals
4444
org.gradle.internal.repository.max.retries=10

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414

1515
distributionBase=GRADLE_USER_HOME
1616
distributionPath=wrapper/dists
17-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-all.zip
17+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip
1818
zipStoreBase=GRADLE_USER_HOME
1919
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)