From 6b14a9f17500441c29667b1b1610f70286257226 Mon Sep 17 00:00:00 2001 From: shabinder Date: Sun, 5 Sep 2021 20:19:55 +0530 Subject: [PATCH] Release Workflow Setup --- .github/workflows/build-desktop-jars.yml | 95 +++++++++++++++++++ desktop/build.gradle.kts | 7 +- desktop/src/jvmMain/kotlin/Main.kt | 3 +- .../src/jvmMain/kotlin/utils/AnalyticsExt.kt | 29 ------ 4 files changed, 99 insertions(+), 35 deletions(-) create mode 100644 .github/workflows/build-desktop-jars.yml delete mode 100644 desktop/src/jvmMain/kotlin/utils/AnalyticsExt.kt diff --git a/.github/workflows/build-desktop-jars.yml b/.github/workflows/build-desktop-jars.yml new file mode 100644 index 00000000..833a6b4c --- /dev/null +++ b/.github/workflows/build-desktop-jars.yml @@ -0,0 +1,95 @@ +on: + [workflow_dispatch] + +jobs: + create-linux-package: + runs-on: ubuntu-latest + name: Create Deb Package + steps: + # Setup Java environment for the next steps + - name: Setup Java + uses: actions/setup-java@v1 + with: + java-version: 15 + + # Check out current repository + - name: Fetch Sources + uses: actions/checkout@v2.3.1 + + # Build Desktop application + - name: Desktop App + run: ./gradlew :desktop:packageUberJarForCurrentOS + + # Create a Draft Release + - name: Draft Release + uses: ncipollo/release-action@v1 + with: + draft: true + tag: "3.3.0" + artifacts: "desktop\build\compose\jars\*.jar" + token: ${{ secrets.GH_TOKEN }} + commit: main +# bodyFile: "body.md" +# +# create-macos-package: +# runs-on: macos-latest +## needs: create_staging_repository +# steps: +# - name: Checkout +# uses: actions/checkout@v2 +# - name: Configure JDK +# uses: actions/setup-java@v1 +# with: +# java-version: 14 +# - name: Publish +# run: | +# ./gradlew publishAllPublicationsToMavenRepository -PSONATYPE_REPOSITORY_ID=${{ needs.create_staging_repository.outputs.repository_id }} +# env: +# MANUAL_REPOSITORY: ${{ secrets.MANUAL_REPOSITORY }} +# SONATYPE_REPOSITORY_ID: ${{ needs.create_staging_repository.outputs.repository_id }} +# SONATYPE_USERNAME: ${{ secrets.NEXUS_ACTIONS_SONATYPE_USERNAME }} +# SONATYPE_PASSWORD: ${{ secrets.NEXUS_ACTIONS_SONATYPE_PASSWORD }} +# GPG_PRIVATE_KEY: ${{ secrets.NEXUS_ACTIONS_GPG_PRIVATE_KEY }} +# GPG_PRIVATE_PASSWORD: ${{ secrets.NEXUS_ACTIONS_GPG_PRIVATE_PASSWORD }} +# +# create-windows-package: +# runs-on: windows-latest +# needs: create_staging_repository +# steps: +# - name: Checkout +# uses: actions/checkout@v2 +# - name: Configure JDK +# uses: actions/setup-java@v1 +# with: +# java-version: 14 +# - name: Publish +# run: | +# ./gradlew publishMingwX64PublicationToMavenRepository -PSONATYPE_REPOSITORY_ID=${{ needs.create_staging_repository.outputs.repository_id }} +# env: +# MANUAL_REPOSITORY: ${{ secrets.MANUAL_REPOSITORY }} +# SONATYPE_REPOSITORY_ID: ${{ needs.create_staging_repository.outputs.repository_id }} +# SONATYPE_USERNAME: ${{ secrets.NEXUS_ACTIONS_SONATYPE_USERNAME }} +# SONATYPE_PASSWORD: ${{ secrets.NEXUS_ACTIONS_SONATYPE_PASSWORD }} +# GPG_PRIVATE_KEY: ${{ secrets.NEXUS_ACTIONS_GPG_PRIVATE_KEY }} +# GPG_PRIVATE_PASSWORD: ${{ secrets.NEXUS_ACTIONS_GPG_PRIVATE_PASSWORD }} +# +# finalize: +# runs-on: ubuntu-latest +# needs: [create_staging_repository,macos,windows] +# if: ${{ always() && needs.create_staging_repository.result == 'success' }} +# steps: +# - name: Discard +# if: ${{ needs.macos.result != 'success' || needs.windows.result != 'success' }} +# uses: nexus-actions/drop-nexus-staging-repo@main +# with: +# username: ${{ secrets.NEXUS_ACTIONS_SONATYPE_USERNAME }} +# password: ${{ secrets.NEXUS_ACTIONS_SONATYPE_PASSWORD }} +# staging_repository_id: ${{ needs.create_staging_repository.outputs.repository_id }} +# - name: Release +# if: ${{ needs.macos.result == 'success' && needs.windows.result == 'success' }} +# uses: nexus-actions/release-nexus-staging-repo@main +# with: +# base_url: https://s01.oss.sonatype.org/service/local/ +# username: ${{ secrets.NEXUS_ACTIONS_SONATYPE_USERNAME }} +# password: ${{ secrets.NEXUS_ACTIONS_SONATYPE_PASSWORD }} +# staging_repository_id: ${{ needs.create_staging_repository.outputs.repository_id }} diff --git a/desktop/build.gradle.kts b/desktop/build.gradle.kts index ac71c2ad..e788c467 100644 --- a/desktop/build.gradle.kts +++ b/desktop/build.gradle.kts @@ -57,8 +57,6 @@ kotlin { // Koin implementation(Koin.core) - // Matomo - implementation("org.piwik.java.tracking:matomo-java-tracker:1.6") } } val jvmTest by getting @@ -68,7 +66,7 @@ kotlin { compose.desktop { application { mainClass = "MainKt" - description = "Music Downloader for Spotify, Gaana, Youtube Music." + description = "Music Downloader for Spotify, Gaana, Jio Saavn, Youtube Music." nativeDistributions { modules("java.sql", "java.security.jgss", "jdk.crypto.ec") targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb) @@ -84,7 +82,8 @@ compose.desktop { windows { iconFile.set(iconsRoot.resolve("spotiflyer.ico")) // Wondering what the heck is this? See : https://wixtoolset.org/documentation/manual/v3/howtos/general/generate_guids.html - upgradeUuid = "ace223ed-3ffb-452c-bc90-082e9e0a6d5d" + // https://www.guidgen.com/ + upgradeUuid = "9f9e966b-7eef-42c7-a49c-5194b17fabd0" menuGroup = packageName } linux { diff --git a/desktop/src/jvmMain/kotlin/Main.kt b/desktop/src/jvmMain/kotlin/Main.kt index b1155e72..dfbb1f1c 100644 --- a/desktop/src/jvmMain/kotlin/Main.kt +++ b/desktop/src/jvmMain/kotlin/Main.kt @@ -20,7 +20,6 @@ import androidx.compose.material.Surface import androidx.compose.ui.Modifier import androidx.compose.ui.awt.ComposeWindow import androidx.compose.ui.graphics.Color -import androidx.compose.ui.graphics.Path import androidx.compose.ui.unit.dp import androidx.compose.ui.window.Window import androidx.compose.ui.window.application @@ -97,7 +96,7 @@ fun main() { // FFmpeg WARNING try { - FFmpeg.atPath().addArgument("-version").execute(); + FFmpeg.atPath().addArgument("-version").execute() } catch (e: Exception) { if (e is JaffreeException) methods.value.showPopUpMessage("WARNING!\nFFmpeg not found at path") } diff --git a/desktop/src/jvmMain/kotlin/utils/AnalyticsExt.kt b/desktop/src/jvmMain/kotlin/utils/AnalyticsExt.kt deleted file mode 100644 index 19573ffd..00000000 --- a/desktop/src/jvmMain/kotlin/utils/AnalyticsExt.kt +++ /dev/null @@ -1,29 +0,0 @@ -package utils - -import org.piwik.java.tracking.PiwikRequest -import org.piwik.java.tracking.PiwikTracker -import java.net.URL - -fun PiwikTracker.trackAsync( - baseURL: String = "https://com.shabinder.spotiflyer/", - requestBuilder: PiwikRequest.() -> Unit = {} -) { - val req = PiwikRequest( - 1, - URL(baseURL) - ).apply { requestBuilder() } - // Send Request - sendRequestAsync(req) -} - -fun PiwikTracker.trackScreenAsync( - screenAddress: String, - requestBuilder: PiwikRequest.() -> Unit = {} -) { - val req = PiwikRequest( - 1, - URL("https://com.shabinder.spotiflyer$screenAddress") - ).apply { requestBuilder() } - // Send Request - sendRequestAsync(req) -}