Skip to content

Commit

Permalink
Updating github action
Browse files Browse the repository at this point in the history
  • Loading branch information
mirzemehdi committed Jan 21, 2024
1 parent 35322a4 commit e9d05c8
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
branches: [ "main" ]
tags:
- 'v*'
paths-ignore:
- '**/README.md'
pull_request:
branches: [ "main" ]

Expand Down Expand Up @@ -106,3 +108,66 @@ jobs:
with:
generate_release_notes: true
token: ${{ env.github_token }}


create-staging-repository:
runs-on: ubuntu-latest
name: Create staging repository
needs: release
outputs:
repository_id: ${{ steps.create.outputs.repository_id }}
steps:
- id: create
uses: nexus-actions/create-nexus-staging-repo@v1.3.0
with:
username: ${{ secrets.SONATYPE_USERNAME }}
password: ${{ secrets.SONATYPE_PASSWORD }}
staging_profile_id: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
description: Created by GitHub Actions
base_url: https://s01.oss.sonatype.org/service/local/

publish:
name: Publish to Maven
runs-on: macos-latest
needs: create-staging-repository
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Setup gradle
uses: gradle/gradle-build-action@v2.4.2

- name: Write secrets to local.properties
run: |
echo sonatypeUsername="${SONATYPE_USERNAME}" >> "local.properties"
echo sonatypePassword="${SONATYPE_PASSWORD}" >> "local.properties"
echo gpgKeyPassword="${GPG_KEY_PASSWORD}" >> "local.properties"
echo gpgKeySecret="${GPG_KEY_SECRET}" >> "local.properties"
env:
SONATYPE_REPOSITORY_ID: ${{ needs.create-staging-repository.outputs.repository_id }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GPG_KEY_PASSWORD: ${{ secrets.GPG_KEY_PASSWORD }}
GPG_KEY_SECRET: ${{ secrets.GPG_KEY_SECRET }}

- name: Release to sonatype
run: ./gradlew publishAllPublicationsToMavenRepository

close-staging-repository:
name: Close staging repository
runs-on: ubuntu-latest
needs: [ create-staging-repository, publish ]
if: ${{ always() && needs.create_staging_repository.result == 'success' }}
steps:
- name: Close staging repository
uses: nexus-actions/release-nexus-staging-repo@6632a81bfab63557b2717e8423b0a620ae5aa414
with:
username: ${{ secrets.SONATYPE_USERNAME }}
password: ${{ secrets.SONATYPE_PASSWORD }}
staging_repository_id: ${{ needs.create-staging-repository.outputs.repository_id }}
base_url: https://s01.oss.sonatype.org/service/local/
68 changes: 0 additions & 68 deletions .github/workflows/publish.yml

This file was deleted.

2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ kotlin.mpp.enableCInteropCommonization=true
#Development
development=true

kmpAuthVersion=1.0.0-RC1
kmpAuthVersion=1.0.0
2 changes: 1 addition & 1 deletion kmpauth-google/kmpauth_google.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'kmpauth_google'
spec.version = '0.0.4'
spec.version = '1.0.0'
spec.homepage = ''
spec.source = { :http=> ''}
spec.authors = ''
Expand Down

0 comments on commit e9d05c8

Please sign in to comment.