Skip to content

Commit 653db1c

Browse files
DTSCCI-2086 CME-731 Switch from Jitpack to Azure DevOps Artifacts (#110)
* DTSCCI-2086 Switch from Jitpack to Azure DevOps Artifacts * DTSCCI-2086 Switch from Jitpack to Azure DevOps Artifacts * Wrapped maven in repositories code block * Set publish to use Java 11 * Added groovy version to dependencies Added groovy version to dependencies to attempt to fix publish errors * Revert groovy dependency change * Added changes required for publish * Changed order in publishing block * Update build.gradle * upgraded Gradle to V7 * Removed code not required --------- Co-authored-by: Ben James <133333764+ben-james-hmcts@users.noreply.github.com> Co-authored-by: Ben James <ben.james@hmcts.net>
1 parent 53d8a1f commit 653db1c

File tree

4 files changed

+53
-48
lines changed

4 files changed

+53
-48
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Publish to Azure Artifacts
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- '*'
8+
9+
jobs:
10+
PublishToAzureArtifacts:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
with:
17+
submodules: recursive
18+
19+
- name: Set up JDK
20+
uses: actions/setup-java@v4
21+
with:
22+
distribution: 'temurin'
23+
java-version: 11
24+
cache: 'gradle'
25+
26+
- name: Publish to Azure DevOps Artifacts
27+
run: |
28+
./gradlew publish
29+
env:
30+
AZURE_DEVOPS_ARTIFACT_USERNAME: ${{ secrets.AZURE_DEVOPS_ARTIFACT_USERNAME }}
31+
AZURE_DEVOPS_ARTIFACT_TOKEN: ${{ secrets.AZURE_DEVOPS_ARTIFACT_TOKEN }}
32+
RELEASE_VERSION: ${{ github.ref_name }}
33+
shell: bash

.github/workflows/jitpack-build.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

build.gradle

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
buildscript {
2-
repositories {
3-
jcenter()
4-
}
5-
}
6-
71
plugins {
82
id 'checkstyle'
93
id 'io.spring.dependency-management' version '1.1.7'
@@ -18,7 +12,7 @@ apply plugin: 'maven-publish'
1812

1913
def buildNumber = System.getenv("RELEASE_VERSION")?.replace("refs/tags/", "") ?: "DEV-SNAPSHOT"
2014

21-
group 'uk.gov.hmcts.reform'
15+
group 'com.github.hmcts'
2216
version buildNumber
2317

2418
sourceCompatibility = 11
@@ -86,15 +80,16 @@ tasks.withType(Test) {
8680
failFast = true
8781
}
8882

83+
tasks.withType(Copy).configureEach {
84+
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
85+
}
86+
8987
repositories {
88+
mavenLocal()
89+
mavenCentral()
9090
maven {
91-
url "https://dl.bintray.com/hmcts/hmcts-maven"
92-
}
93-
maven {
94-
url 'https://repo.spring.io/libs-milestone'
91+
url 'https://pkgs.dev.azure.com/hmcts/Artifacts/_packaging/hmcts-lib/maven/v1'
9592
}
96-
jcenter()
97-
mavenLocal()
9893
}
9994

10095
jar {
@@ -159,6 +154,17 @@ publishing {
159154
}
160155
}
161156
}
157+
158+
repositories {
159+
maven {
160+
name = "AzureArtifacts"
161+
url = uri("https://pkgs.dev.azure.com/hmcts/Artifacts/_packaging/hmcts-lib/maven/v1")
162+
credentials {
163+
username = System.getenv("AZURE_DEVOPS_ARTIFACT_USERNAME")
164+
password = System.getenv("AZURE_DEVOPS_ARTIFACT_TOKEN")
165+
}
166+
}
167+
}
162168
}
163169

164170

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.4-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)