Skip to content

Commit

Permalink
Deploy: Merge final release v1.06 build 1 (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
F4bioo authored Jun 17, 2024
2 parents 171b367 + f02f9a7 commit 279db15
Show file tree
Hide file tree
Showing 9 changed files with 183 additions and 146 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/publish-library.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Publish Library

on:
push:
tags:
- 'v*.*.*'

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Cache Gradle dependencies
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle-

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

- name: Grant Gradlew Permission
run: chmod +x gradlew

- name: Create KeyRingFile File
run: |
echo "$PGP_PRIVATE_KEY" | gpg --dearmor > secring.gpg
if ! test -f secring.gpg; then
echo "secring.gpg not found"
exit 1
fi
env:
PGP_PRIVATE_KEY: ${{ secrets.PGP_PRIVATE_KEY }}

- name: Publish Library to Maven Central
run: ./gradlew publishAndReleaseToMavenCentral --no-configuration-cache
env:
mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }}
mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }}
signing.keyId: ${{ secrets.PGP_KEY_ID }}
signing.password: ${{ secrets.PGP_PRIVATE_KEY }}
signing.secretKeyRingFile: secring.gpg

- name: Delete KeyRingFile File
run: rm -f secring.gpg
129 changes: 52 additions & 77 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
- name: Create APK Build Artifacts Folder
run: mkdir -p apk-build-artifacts

- name: Move APK Builds Files to apk-build-artifacts
- name: Move APK Build File to apk-build-artifacts
run: mv app/build/outputs/apk/release/app-release-unsigned.apk apk-build-artifacts/app-release-unsigned.apk

- name: List Upload APK Build Artifacts
Expand All @@ -104,14 +104,21 @@ jobs:
name: apk-build
path: apk-build-artifacts

aar-build:
lib-build:
needs: lib-version
name: AAR Build
name: LIB Build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-maven-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-maven-

- name: Cache Gradle dependencies
uses: actions/cache@v2
with:
Expand All @@ -130,66 +137,44 @@ jobs:
- name: Grant Gradlew Permission
run: chmod +x gradlew

- name: Build AAR Library
run: ./gradlew publishReleasePublicationToMavenLocal
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
PGP_PRIVATE_KEY: ${{ secrets.PGP_PRIVATE_KEY }}
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}

- name: Create AAR Build Artifacts Folder
run: mkdir -p aar-build-artifacts

- name: Move AAR Builds Files to aar-build-artifacts
run: mv tourtip/build/outputs/aar/tourtip-release.aar aar-build-artifacts/tourtip-release.aar

- name: List Upload AAR Build Artifacts
run: ls -l aar-build-artifacts

- name: Upload AAR Build Artifacts
uses: actions/upload-artifact@v3
- name: Download LIB Version Artifacts
uses: actions/download-artifact@v3
with:
retention-days: 1
name: aar-build
path: aar-build-artifacts
name: lib-version
path: lib-version-artifacts

sign-pgp:
needs: aar-build
name: Sign PGP
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: List Download LIB Version Artifacts
run: ls -l lib-version-artifacts

- name: Download AAR Build Artifacts
uses: actions/download-artifact@v3
with:
name: aar-build
path: aar-build-artifacts
- name: Read Release Tag File
run: echo "RELEASE_TAG=$(cat lib-version-artifacts/release_tag.txt)" >> $GITHUB_ENV

- name: List Download AAR Build Artifacts
run: ls -l aar-build-artifacts
- name: Build LIB files
run: ./gradlew publishMavenPublicationToMavenLocal
env:
PGP_KEY_ID: ${{ secrets.PGP_KEY_ID }}
PGP_PRIVATE_KEY: ${{ secrets.PGP_PRIVATE_KEY }}
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}

- name: Import PGP Key
run: echo "${{ secrets.PGP_PRIVATE_KEY }}" | gpg --batch --import
- name: Create LIB Build Artifacts Folder
run: mkdir -p lib-build-artifacts

- name: Sign AAR with PGP
run: echo "${{ secrets.PGP_PASSPHRASE }}" | gpg --batch --yes --pinentry-mode loopback --passphrase-fd 0 --armor --detach-sign aar-build-artifacts/tourtip-release.aar
- name: Move LIB Build Files to lib-build-artifacts
run: cp ~/.m2/repository/com/fappslab/tourtip/tourtip/${{ env.RELEASE_TAG }}/* lib-build-artifacts/

- name: List PGP Sign AAR Build Artifacts
run: ls -l aar-build-artifacts
- name: List Upload LIB Build Artifacts
run: ls -l lib-build-artifacts

- name: Upload PGP Sign Build Artifacts
- name: Upload LIB Build Artifacts
uses: actions/upload-artifact@v3
with:
retention-days: 1
name: sign-pgp
path: aar-build-artifacts
name: lib-build
path: lib-build-artifacts

lib-deploy:
needs: sign-pgp
name: App Deploy
create-release:
needs: [apk-build, lib-build]
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand Down Expand Up @@ -227,20 +212,20 @@ jobs:
name: apk-build
path: apk-build-artifacts

- name: Download AAR Build Artifacts
- name: Download LIB Build Artifacts
uses: actions/download-artifact@v3
with:
name: sign-pgp
path: aar-build-artifacts
name: lib-build
path: lib-build-artifacts

- name: List Download LIB Version Artifacts
run: ls -l lib-version-artifacts

- name: List Download APK Build Artifacts
run: ls -l apk-build-artifacts

- name: List Download AAR Build Artifacts
run: ls -l aar-build-artifacts
- name: List Download LIB Build Artifacts
run: ls -l lib-build-artifacts

- name: Read Release Tag File
run: echo "RELEASE_TAG=$(cat lib-version-artifacts/release_tag.txt)" >> $GITHUB_ENV
Expand Down Expand Up @@ -281,30 +266,20 @@ jobs:
asset_name: tourtip-sample-v${{ env.RELEASE_TAG }}-unsigned.apk
asset_content_type: application/vnd.android.package-archive

- name: Upload AAR Release Asset
- name: Upload LIB Release Assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: aar-build-artifacts/tourtip-release.aar
asset_name: tourtip-v${{ env.RELEASE_TAG }}.aar
asset_content_type: application/java-archive
asset_path: lib-build-artifacts/
asset_name: tourtip-v${{ env.RELEASE_TAG }}
asset_content_type: application/zip

- name: Upload PGP Signature Release Asset for AAR
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: aar-build-artifacts/tourtip-release.aar.asc
asset_name: tourtip-v${{ env.RELEASE_TAG }}.aar.asc
asset_content_type: application/pgp-signature

- name: Publish Library to Maven Central
run: ./gradlew publishReleasePublicationToSonatypeRepository
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
PGP_PRIVATE_KEY: ${{ secrets.PGP_PRIVATE_KEY }}
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
- name: Delete Release Artifacts
run: |
rm -rf lib-version-artifacts
rm -rf apk-build-artifacts
rm -rf lib-build-artifacts
rm -f FINAL_RELEASE_NOTES.md
rm -f TEMP_RELEASE_NOTES.md
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ render.experimental.xml
*.jks
*.keystore
*.asc
*.gpg
*.properties
secrets/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@ package com.fappslab.tourtip.sample.presentation.compose.component.extension
import androidx.compose.ui.geometry.Rect
import androidx.compose.ui.graphics.Path

/**
* This file contains examples of how to create custom highlight types for the Tourtip library.
*
* The `drawZigzagRect` and `drawWavyRect` functions are used to create custom shapes for the highlight.
* These functions are used in the `TooltipSetup.kt` file to create custom highlight types for the tooltips.
*
* `drawZigzagRect` creates a zigzag rectangle shape, and `drawWavyRect` creates a wavy rectangle shape.
* These shapes are then used as the highlight for the tooltips in the `TooltipSetup.kt` file.
*
* You can use these functions as a starting point to create your own custom highlight types.
*/

fun Path.drawZigzagRect(bounds: Rect, zigzagSize: Float = 10f) {
val zigzagPath = Path()
val stepsX = (bounds.width / zigzagSize).toInt()
Expand Down Expand Up @@ -64,7 +76,7 @@ fun Path.drawWavyRect(bounds: Rect, waveLength: Float = 20f, waveHeight: Float =
wavyPath.lineTo(startX, startY)
}
if (endX <= bounds.right) {
wavyPath.quadraticTo(midX, midY, endX, startY)
quadraticTo(wavyPath, startX, startY, midX, midY, endX, startY)
}
}

Expand All @@ -78,7 +90,7 @@ fun Path.drawWavyRect(bounds: Rect, waveLength: Float = 20f, waveHeight: Float =

wavyPath.lineTo(startX, startY)
if (endY <= bounds.bottom) {
wavyPath.quadraticTo(midX, midY, startX, endY)
quadraticTo(wavyPath, startX, startY, midX, midY, startX, endY)
}
}

Expand All @@ -92,7 +104,7 @@ fun Path.drawWavyRect(bounds: Rect, waveLength: Float = 20f, waveHeight: Float =

wavyPath.lineTo(startX, startY)
if (endX >= bounds.left) {
wavyPath.quadraticTo(midX, midY, endX, startY)
quadraticTo(wavyPath, startX, startY, midX, midY, endX, startY)
}
}

Expand All @@ -106,10 +118,29 @@ fun Path.drawWavyRect(bounds: Rect, waveLength: Float = 20f, waveHeight: Float =

wavyPath.lineTo(startX, startY)
if (endY >= bounds.top) {
wavyPath.quadraticTo(midX, midY, startX, endY)
quadraticTo(wavyPath, startX, startY, midX, midY, startX, endY)
}
}

wavyPath.close()
this.addPath(wavyPath)
}

private fun quadraticTo(
path: Path,
startX: Float,
startY: Float,
midX: Float,
midY: Float,
endX: Float,
endY: Float
) {
path.cubicTo(
(startX + 2 * midX) / 3,
(startY + 2 * midY) / 3,
(2 * midX + endX) / 3,
(2 * midY + endY) / 3,
endX,
endY
)
}
5 changes: 2 additions & 3 deletions buildSrc/src/main/java/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ object Config {
const val versionName: String = "1.06"

// Library configuration
val ARTEFACT_ID: String = PACKAGE_NAME.substringAfterLast(delimiter = ".")
const val VERSION: String = "$versionName.$versionCode-SNAPSHOT"
const val GROUP_ID: String = PACKAGE_NAME
private const val SNAPSHOT: String = "" //"-SNAPSHOT"
const val VERSION: String = "$versionName.$versionCode$SNAPSHOT"
}
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ activityCompose = "1.9.0"
composeBom = "2024.06.00"
appcompat = "1.7.0"
material = "1.12.0"
material3 = "1.3.0-beta03"
material3 = "1.2.1"
mavenPublish = "0.28.0"

[libraries]
Expand Down
Loading

0 comments on commit 279db15

Please sign in to comment.