Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create publish.yml #37

Merged
merged 2 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Publish Passage Package

on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '17'

- name: Set up GPG
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: |
echo "$GPG_PRIVATE_KEY" | gpg --batch --import
echo "signing.gnupg.keyName=${{ secrets.GPG_KEY_NAME }}" >> gradle.properties
echo "signing.gnupg.passphrase=${{ secrets.GPG_PASSPHRASE }}" >> gradle.properties

- name: Publish to Maven Central
run: ./gradlew :passage:publish

- name: Wait for Staging Repository to be Created
run: sleep 60

- name: Get Staging Repository ID
id: get_repo_id
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
run: |
response=$(curl -u ${{ secrets.OSSRH_USERNAME }}:${{ secrets.OSSRH_PASSWORD }} -X GET "https://s01.oss.sonatype.org/service/local/staging/profile_repositories")
repo_id=$(echo $response | jq -r '.data[] | select(.repositoryType=="open") | .repositoryId')
echo "::set-output name=repo_id::$repo_id"

- name: Close and Release Repository
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
run: |
repo_id=${{ steps.get_repo_id.outputs.repo_id }}
curl -u ${{ secrets.OSSRH_USERNAME }}:${{ secrets.OSSRH_PASSWORD }} \
-X POST https://s01.oss.sonatype.org/service/local/staging/bulk/close \
-H "Content-Type: application/xml" \
-d "<promoteRequest><data><stagedRepositoryId>$repo_id</stagedRepositoryId></data></promoteRequest>"

# Wait for repository to close
sleep 60

curl -u ${{ secrets.OSSRH_USERNAME }}:${{ secrets.OSSRH_PASSWORD }} \
-X POST https://s01.oss.sonatype.org/service/local/staging/bulk/promote \
-H "Content-Type: application/xml" \
-d "<promoteRequest><data><stagedRepositoryId>$repo_id</stagedRepositoryId></data></promoteRequest>"
6 changes: 3 additions & 3 deletions passage/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ apply plugin: 'maven-publish'
apply plugin: 'signing'

group = "id.passage.android"
version = "1.7.1"
version = "1.7.2"

def localProperties = new Properties()
File localPropertiesFile = rootProject.file('local.properties')
Expand All @@ -30,8 +30,8 @@ android {
defaultConfig {
minSdk 28 // Minimum support for Credentials Manager - ie passkeys
targetSdk 34
versionCode 12
versionName "1.7.1"
versionCode 13
versionName "1.7.2"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down