diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..dda4a42 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,113 @@ +# ADD IN .github/workflows/publish.yml +name: Publish Library to Maven Central +run-name: πŸš€ Β‘ktheme 2 c-mvn! πŸš€ +on: + push: + branches: [ "Releases" ] + paths: + - 'ktheme/build.gradle.kts' + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + ktheme: + name: Build-Publish Ktheme + runs-on: macos-latest + steps: + - name: πŸ—ƒοΈ Checkout code + uses: actions/checkout@v4 + + - name: πŸ“² Setup Java + uses: actions/setup-java@v4 + with: + distribution: 'zulu' + java-version: '17' + + - name: πŸ› οΈ Dearmor sign-key + env: + SIGNING_KEY: ${{ secrets.SIGNING_KEY }} + run: echo "$SIGNING_KEY" | gpg --dearmor > ${HOME}/secring.gpg + + - name: πŸ§ͺ Setup Gradle + uses: gradle/actions/setup-gradle@v3 + + - name: πŸ”“ chmod +x gradlew + run: chmod +x gradlew + + - name: πŸŽ›οΈ Add Gradle Properties + env: + MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} + MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} + SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} + SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }} + run: | + echo "mavenCentralUsername=${MAVEN_CENTRAL_USERNAME}" >> gradle.properties + echo "mavenCentralPassword=${MAVEN_CENTRAL_PASSWORD}" >> gradle.properties + echo "signing.keyId=${SIGNING_KEY_ID}" >> gradle.properties + echo "signing.password=${SIGNING_KEY_PASSWORD}" >> gradle.properties + echo "signing.secretKeyRingFile=${HOME}/secring.gpg" >> gradle.properties + + - name: πŸ› οΈ Setup Xcode + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + + - name: πŸ“‘ Publish To Maven Central + run: | + ./gradlew :ktheme:publishAndReleaseToMavenCentral --no-configuration-cache --stacktrace + + - name: πŸŽ‰ Congratulations πŸŽ‰ + run: | + echo "Your Library is Up" + echo "πŸŽ‰ Congratulations πŸŽ‰" + + sample: + name: Publish Sample App + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + runs-on: ubuntu-latest + steps: + + - name: πŸ—ƒοΈ Checkout code + uses: actions/checkout@v4 + + - name: 🧩 Setup Pages + uses: actions/configure-pages@v5 + + - name: πŸ§ͺ Setup Gradle + uses: gradle/gradle-build-action@v3 + + - name: πŸ“² Setup Java + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: 17 + + - name: πŸ”“ chmod +x gradlew + run: chmod +x gradlew + + - name: πŸ”¨ Build with Gradle + run: ./gradlew :sample:composeApp:wasmJsBrowserDistribution + + - name: πŸ“€ Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: './sample/composeApp/build/dist/wasmJs/productionExecutable' + + - name: πŸ“‘ Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 + + - name: πŸŽ‰ Congratulations πŸŽ‰ + run: | + echo "Your Library is Up" + echo "πŸŽ‰ Congratulations πŸŽ‰" diff --git a/ktheme/build.gradle.kts b/ktheme/build.gradle.kts index f4803f9..92cf91e 100644 --- a/ktheme/build.gradle.kts +++ b/ktheme/build.gradle.kts @@ -145,7 +145,7 @@ mavenPublishing { coordinates( groupId = "com.feraxhp.ktheme", artifactId = "ktheme-compose", - version = "0.0.1" + version = "0.0.2" ) // Configure POM metadata for the published artifact