OSDN Git Service

Release to Azure Artifactory
authorHiroshi Miura <miurahr@linux.com>
Sat, 13 Mar 2021 08:30:57 +0000 (17:30 +0900)
committerHiroshi Miura <miurahr@linux.com>
Sat, 13 Mar 2021 08:30:57 +0000 (17:30 +0900)
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
.github/workflows/build-release-and-upload.yml
.gitlab-ci.yml [deleted file]
README.md
build.gradle

index 00a4e3a..e98fbc3 100644 (file)
@@ -37,6 +37,13 @@ jobs:
         GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
       with:
         arguments: publishMavenJavaPublicationToGitHubPackagesRepository
+    - uses: eskatos/gradle-command-action@v1
+      name: Releaase artifact to Azure packages
+      env:
+        AZURE_USER: ${{ secrets.AZURE_USER }}
+        AZURE_TOKEN: ${{ secrets.AZURE_TOKEN }}
+      with:
+        arguments: publishMavenJavaPublicationToAzurePackagesRepository
     - name: Upload Release Asset(cli.zip)
       id: upload-release-asset-zip
       uses: actions/upload-release-asset@v1
@@ -56,7 +63,7 @@ jobs:
         upload_url: ${{ steps.create_release.outputs.upload_url }}
         asset_path: dictzip-cli/build/distributions/dictzip-${{ steps.get_version.outputs.VERSION }}.tgz
         asset_name: dictzip-${{ steps.get_version.outputs.VERSION }}.tgz
-        asset_content_type: application/gzip
+        asset_content_type: application/x-gtar
     - name: Upload Release Asset(lib.jar)
       id: upload-release-asset-lib
       uses: actions/upload-release-asset@v1
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
deleted file mode 100644 (file)
index 8b72fa7..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-deploy:
-  image: gradle:6.8.3-jdk11
-  script:
-    - 'gradle publishMavenJavaPublicationToGitLabPackagesRepository'
-  rules:
-    - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_TAG'
index 1f70937..b9f4a62 100644 (file)
--- a/README.md
+++ b/README.md
@@ -7,18 +7,35 @@ DictZip, GZip random access compression format(.dz), access library for Java
 
 ## Usage
 
-Extract archive in directory. If you want to use just library, `dictzip-lib.jar`
+Extract archive in directory. If you want to use just library, `dictzip-lib.jar`
 is an only file for you.
 CLI is also made for example of API usage and will be a good reference.
 Also there is a javadoc of DictZip at https://miurahr.github.io/dictzip-java
 
-### from maven/gradle
+### gradle
 
-dictzip library is registered at JCenter repository. You can download
-from JCenter specifying as follows:
+dictzip library is published on GitHub Packages repository and Azure Artifactory repository.
 
 ```
-org.dict.zip:dictzip-lib:0.8.2
+repositories {
+    maven { // when use github
+        url "https://maven.pkg.github.com/dictzip/dictzip-java"
+        credentials {
+            username = 'github username'
+            password = 'personal access token'
+        }
+    }
+    maven { // when use Azure
+        url "https://pkgs.dev.azure.com/miurahr/github/_packaging/maven/maven/v1"
+        credentials {
+            username = 'azure devops username'
+            password = 'personal access token'
+        }
+    }
+}
+dependencies {
+    implementation 'org.dict.zip:dictzip-lib:0.9.1'
+}
 ```
 
 ## Build
index c4513ea..88dc1d8 100644 (file)
@@ -8,22 +8,7 @@ plugins {
 }
 
 // Drop prefix 'v' from latest tag version.
-version = {it -> it.substring(1, it.length())}(gitVersion())
-
-repositories {
-    mavenCentral()
-    maven {
-        name = "GitLabPackages"
-        url "https://gitlab.com/api/v4/groups/dictzip/-/packages/maven"
-        credentials(HttpHeaderCredentials) {
-            name = 'Job-Token'
-            value = System.getenv("CI_JOB_TOKEN")
-        }
-        authentication {
-            header(HttpHeaderAuthentication)
-        }
-    }
-}
+version = gitVersion().substring(1)
 
 // common settings
 subprojects {
@@ -43,6 +28,10 @@ subprojects {
     version = rootProject.version
     group = projectGroup
 
+    repositories {
+        mavenCentral()
+    }
+
     dependencies {
         testImplementation 'commons-io:commons-io:2.6'
         testImplementation 'org.testng:testng:6.9.10'
@@ -122,7 +111,6 @@ project(':dictzip-lib') {
                             url.set("https://github.com/dictzip/dictzip-java")
                         }
                         issueManagement {
-                            system.set("Trac")
                             url.set("https://github.com/dictzip/dictzip-java/issues")
                         }
                     }
@@ -139,14 +127,14 @@ project(':dictzip-lib') {
                 }
             }
             maven {
-                name = "GitLabPackages"
-                url = "https://gitlab.com/api/v4/groups/dictzip/-/packages/maven"
-                credentials(HttpHeaderCredentials) {
-                    name = 'Job-Token'
-                    value = System.getenv("CI_JOB_TOKEN")
+                name 'AzurePackages'
+                url 'https://pkgs.dev.azure.com/miurahr/github/_packaging/maven/maven/v1'
+                credentials(PasswordCredentials) {
+                    username = System.getenv("AZURE_USER")
+                    password = System.getenv("AZURE_TOKEN")
                 }
                 authentication {
-                    header(HttpHeaderAuthentication)
+                    basic(BasicAuthentication)
                 }
             }
         }