-
-
Notifications
You must be signed in to change notification settings - Fork 16
92 lines (89 loc) · 3.47 KB
/
shared-build.yml
File metadata and controls
92 lines (89 loc) · 3.47 KB
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
# A workflow that can be called from other workflows as a way to build a SNAPSHOT of RESTEasy MicroProfile for testing
# purposes. This will attach an archive named "resteasy-mp-maven-repository.tar.gz" which can be downloaded and
# extracted to use the SNAPSHOT dependencies.
#
# An output setting of "resteasy-mp-version" is set with the version of the SNAPSHOT dependencies.
#
# Two input parameters can be set. The parameter resteasy-branch is used to control which branch you'd like a build of.
# The default branch is "main". The parameter resteasy-repo allows you to override the repository used. The default for
# this parameter is "resteasy/resteasy-microprofile".
#
# Example Usage:
#
# jobs:
# resteasy-build:
# uses: resteasy/resteasy-microprofile/.github/workflows/shared-build.yml@main
# with:
# resteasy-branch: ${{ inputs.resteasy-branch }}
# resteasy-repo: ${{ inputs.resteasy-repo }}
#
# custom-build:
# runs-on: ubuntu-latest
# needs: resteasy-build
# steps:
# - uses: actions/checkout@v6
# - uses: actions/download-artifact@v3
# with:
# name: resteasy-mp-maven-repository
# path: .
# - name: Extract Maven Repo
# shell: bash
# run: |
# tar -xzf resteasy-mp-maven-repository.tar.gz -C ~
# - name: Set up JDK ${{ inputs.javaVersion }}
# uses: actions/setup-java@v5
# with:
# java-version: 17
# distribution: 'temurin'
# cache: 'maven'
# - name: Build on Linux with Java 17 using RESTEasy MicroProfile ${{ needs.resteasy-build.outputs.resteasy-mp-version }}
# run: mvn clean verify '-Dversion.dev.resteasy.microprofile=${{ needs.resteasy-build.outputs.resteasy-mp-version }}'
name: Build RESTEasy MicroProfile Upstream
on:
workflow_call:
outputs:
resteasy-mp-version:
description: "The version of RESTEasy MicroProfile that was built"
value: ${{ jobs.resteasy-build.outputs.resteasy-mp-version }}
inputs:
resteasy-branch:
description: "RESTEasy MicroProfile Branch"
required: true
default: "main"
type: string
resteasy-repo:
description: "RESTEasy MicroProfile Repository"
required: true
default: "resteasy/resteasy-microprofile"
type: string
jobs:
resteasy-build:
runs-on: ubuntu-latest
outputs:
resteasy-mp-version: ${{ steps.version.outputs.resteasy-mp-version }}
steps:
- name: Checkout RESTEasy MicroProfile
uses: actions/checkout@v6
with:
repository: ${{ inputs.resteasy-repo }}
ref: ${{ inputs.resteasy-branch }}
- name: Set up JDK 11
uses: actions/setup-java@v5
with:
java-version: 11
distribution: 'temurin'
cache: 'maven'
- name: Build RESTEasy MicroProfile
run: mvn clean install -DskipTests -Dcheckstyle.skip=true -Denforcer.skip=true -DskipFormatting=true
- name: Get the RESTEasy MicroProfile Version
id: version
run: echo "resteasy-mp-version=$(mvn -B help:evaluate -Dexpression=project.version -DforceStdout -q)" >> $GITHUB_OUTPUT
- name: Archive the repository
run: |
cd ~
find ./.m2/repository -type d -name "*SNAPSHOT" -print0 | xargs -0 tar -czf ~/resteasy-mp-maven-repository.tar.gz
- uses: actions/upload-artifact@v6
with:
name: resteasy-mp-maven-repository
path: ~/resteasy-mp-maven-repository.tar.gz
retention-days: 5