Skip to content

Commit ed5b82a

Browse files
authored
Merge pull request #331 from hmcts/reespozzi-patch-1
New ADO publishing
2 parents 35ace30 + 4b61eba commit ed5b82a

2 files changed

Lines changed: 46 additions & 0 deletions

File tree

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@v6
16+
with:
17+
submodules: recursive
18+
19+
- name: Set up JDK
20+
uses: actions/setup-java@v5
21+
with:
22+
distribution: 'temurin'
23+
java-version: 17
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

build.gradle

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,16 @@ ext['gradle.publish.secret'] = System.getenv('GRADLE_PLUGIN_PORTAL_SECRET')
7878

7979
// The tests use copies of this build.
8080
tasks.integrationTest.inputs.files file('test-projects')
81+
82+
publishing {
83+
repositories {
84+
maven {
85+
name = "AzureArtifacts"
86+
url = uri("https://pkgs.dev.azure.com/hmcts/Artifacts/_packaging/hmcts-lib/maven/v1")
87+
credentials {
88+
username = System.getenv("AZURE_DEVOPS_ARTIFACT_USERNAME")
89+
password = System.getenv("AZURE_DEVOPS_ARTIFACT_TOKEN")
90+
}
91+
}
92+
}
93+
}

0 commit comments

Comments
 (0)