-
Notifications
You must be signed in to change notification settings - Fork 181
136 lines (121 loc) · 3.99 KB
/
install_maven_dependencies.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: install_maven_dependencies
# bump git sha
permissions:
checks: write
contents: read
issues: read
pull-requests: write
on:
workflow_call:
inputs:
project:
description: 'Name of the artifact env'
required: false
default: 'prod'
type: string
version_tag:
description: 'Name of the tag to build'
required: false
default: 'latest'
type: string
bump:
description: 'whether to bump the version number by a major minor patch amount or none'
required: false
default: 'patch'
type: string
ref:
description: 'git reference to use with the checkout use default_branch to have that calculated'
required: false
default: "default"
type: string
workflow_dispatch:
inputs:
project:
description: 'Name of the artifact env'
required: false
default: 'prod'
type: string
version_tag:
description: 'Version tag to use: (bump must also be set to none to keep a specific version'
required: false
default: 'latest'
type: string
bump:
description: |
How to optionally bump the semver version ( Major.Minor.Patch ) : git log will be searched for
'#major #minor #patch' or feat/ or fix/ branch names to optionally override the bump. Set to none to keep a specific version
required: false
options:
- patch
- minor
- major
- none
type: choice
ref:
description: 'git reference to use with the checkout use default_branch to have that calculated'
required: false
default: "default"
type: string
jobs:
install_deps:
runs-on: ubuntu-latest
steps:
- name: git-checkout-ref-action
id: ref
uses: ORCID/git-checkout-ref-action@main
with:
default_branch: ${{ github.event.repository.default_branch }}
ref: ${{ inputs.ref }}
- uses: actions/checkout@v4
with:
ref: ${{ steps.ref.outputs.ref }}
# checkout some history so we can scan commits for bump messages
# NOTE: history does not include tags!
fetch-depth: 100
- name: find next version
id: version
uses: ORCID/version-bump-action@main
with:
version_tag: ${{ inputs.version_tag }}
bump: ${{ inputs.bump }}
- name: Set up Open JDK 11
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
- name: Restore the seeded cache but save dependencies into a new unique git sha hash with the expected version of the build
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ steps.version.outputs.version_tag_numeric }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-seed-cache
- name: show path
run: |
echo "$PATH"
which java
echo "$JAVA_HOME"
echo "$tag_numeric"
echo "$project"
if [[ -d ~/.m2/repository/ ]];then
find ~/.m2/repository/ -name '*.jar' | grep orcid
fi
shell: bash
env:
version_tag_numeric: "${{ steps.version.outputs.version_tag_numeric }}"
project: "${{ inputs.project }}"
- name: install_dependencies
id: install_dependencies
uses: ORCID/ORCID-Source-dependencies-action@main
with:
version_tag_numeric: ${{ steps.version.outputs.version_tag_numeric }}
- name: check some build related things
run: |
git --version
git config user.name "GitHub Actions Bot"
git config user.email "<>"
git status
git diff
if [[ -d ~/.m2/repository/ ]];then
find ~/.m2/repository/ -name '*.jar' | grep orcid
fi