-
Notifications
You must be signed in to change notification settings - Fork 384
56 lines (55 loc) · 1.88 KB
/
maven-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: cldr-mvn-deploy
on:
release:
types: [created]
jobs:
mvn-deploy:
runs-on: ubuntu-latest
steps:
# since we have to checkout all branches, cache here
- name: Cache .git
uses: actions/cache@v3
with:
path: .git
key: git-${{ github.base_ref }}-${{ github.sha }}
restore-keys: |
git-${{ github.base_ref }}-${{ github.sha }}
git-${{ github.base_ref }}
git-
- uses: actions/checkout@v4
with:
lfs: false
fetch-depth: 0 # for cldr-archive
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'temurin'
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('tools/**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build with Maven
run: >
mvn -s .github/workflows/mvn-settings.xml -B compile install package --file tools/pom.xml
-DskipTests=true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout CLDR archive
run: >
mkdir -v ../cldr-archive && java -jar tools/cldr-code/target/cldr-code.jar checkout-archive
- name: set version to generic number
run: |
mvn -s .github/workflows/mvn-settings.xml --file tools/pom.xml versions:set -DnewVersion=0.0.0-SNAPSHOT-$(echo ${GITHUB_SHA} | cut -c1-10)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload to GitHub maven
# only for head fork
if: github.repository == 'unicode-org/cldr'
run: |
mvn -s .github/workflows/mvn-settings.xml --file tools/pom.xml source:jar deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}