forked from wildfly/wildfly
-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (96 loc) · 3.44 KB
/
shared-wildfly-build.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
# A workflow that can be called from other workflows as a way to build a SNAPSHOT of WildFly for testing purposes. This
# will attach an archive named "wildfly-maven-repository.tar.gz" which can be downloaded and extracted to use the
# SNAPSHOT dependencies.
#
# An output setting of "wildfly-version" is set with the version of the SNAPSHOT dependencies.
#
# Two input parameters can be set. The parameter wildfly-branch is used to control which branch you'd like a build of.
# The default branch is "main". The parameter wildfly-repo allows you to override the repository used. The default for
# this parameter is "wildfly/wildfly".
#
# Example Usage:
#
# jobs:
# wildfly-build:
# uses: wildfly/wildfly/.github/workflows/shared-wildfly-build.yml@main
# with:
# wildfly-branch: ${{ inputs.wildfly-branch }}
# wildfly-repo: ${{ inputs.wildfly-repo }}
#
# custom-build:
# runs-on: ubuntu-latest
# needs: wildfly-build
# steps:
# - uses: actions/checkout@v4
# - uses: actions/download-artifact@v3
# with:
# name: wildfly-maven-repository
# path: .
# - name: Extract Maven Repo
# shell: bash
# run: |
# tar -xzf wildfly-maven-repository.tar.gz -C ~
# - name: Set up JDK ${{ inputs.javaVersion }}
# uses: actions/setup-java@v4
# with:
# java-version: 17
# distribution: 'temurin'
# cache: 'maven'
# - name: Build on Linux with Java 17 using WildFly ${{ needs.wildfly-build.outputs.wildfly-version }}
# run: mvn clean verify '-Dversion.org.wildfly=${{ needs.wildfly-build.outputs.wildfly-version }}'
name: Build WildFly Upstream
on:
workflow_call:
outputs:
wildfly-version:
description: "The version of WildFly that was built"
value: ${{ jobs.wildfly-build.outputs.wildfly-version }}
inputs:
wildfly-branch:
description: "WildFly Branch"
required: true
default: "main"
type: string
wildfly-repo:
description: "WildFly Repository"
required: true
default: "wildfly/wildfly"
type: string
git-log-number:
description: "Number of commits to display"
required: false
default: 5
type: number
jobs:
wildfly-build:
runs-on: ubuntu-latest
outputs:
wildfly-version: ${{ steps.version.outputs.wildfly-version }}
steps:
- name: Checkout WildFly
uses: actions/checkout@v4
with:
repository: ${{ inputs.wildfly-repo }}
ref: ${{ inputs.wildfly-branch }}
fetch-depth: ${{ inputs.git-log-number }}
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
cache: 'maven'
- name: Show Git commit logs
run: git log -n ${{ inputs.git-log-number }}
- name: Build WildFly
run: mvn -B clean install -DskipTests -Dcheckstyle.skip=true -Denforcer.skip=true
- id: version
run: echo "wildfly-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 ~/wildfly-maven-repository.tar.gz
- uses: actions/upload-artifact@v4
with:
name: wildfly-maven-repository
path: ~/wildfly-maven-repository.tar.gz
retention-days: 5