David Liu

Automatically publish snapshots

... ... @@ -32,3 +32,22 @@ jobs:
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew assemble
- name: Create gpg key and import into gradle properties
run: |
echo $GPG_KEY_ARMOR | base64 --decode > ./release.asc
gpg --quiet --output $GITHUB_WORKSPACE/release.gpg --dearmor ./release.asc
sed -i -e "s,nexusUsername=,nexusUsername=$NEXUS_USERNAME,g" gradle.properties
sed -i -e "s,nexusPassword=,nexusPassword=$NEXUS_PASSWORD,g" gradle.properties
sed -i -e "s,signing.keyId=,signing.keyId=$GPG_KEY_ID,g" gradle.properties
sed -i -e "s,signing.password=,signing.password=$GPG_PASSWORD,g" gradle.properties
sed -i -e "s,signing.secretKeyRingFile=,signing.secretKeyRingFile=$GITHUB_WORKSPACE/release.gpg,g" gradle.properties
env:
GPG_KEY_ARMOR: "${{ secrets.SIGNING_KEY_ARMOR }}"
GPG_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
GPG_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
- name: Publish snapshot
run: ./gradlew publish closeAndReleaseRepository
\ No newline at end of file
... ...
... ... @@ -40,4 +40,13 @@ POM_DEVELOPER_ID=livekit
POM_DEVELOPER_NAME=LiveKit
RELEASE_REPOSITORY_URL=https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/
SNAPSHOT_REPOSITORY_URL=https://s01.oss.sonatype.org/content/repositories/snapshots/
\ No newline at end of file
SNAPSHOT_REPOSITORY_URL=https://s01.oss.sonatype.org/content/repositories/snapshots/
# Variables required to allow build.gradle to parse for publishing.
# WARNING: Do not edit this and potentially commit to repo.
# Instead, override in ~/.gradle/gradle.properties
nexusUsername=
nexusPassword=
signing.keyId=
signing.password=
signing.secretKeyRingFile=
... ...