forked from apache/solr
-
Notifications
You must be signed in to change notification settings - Fork 0
155 lines (132 loc) · 5.17 KB
/
release.yaml
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: Release bugfix version
on:
workflow_dispatch:
inputs:
solr_version:
description: 'The upstream Solr release version'
required: true
default: '9.5.0'
type: string
patch_version:
description: 'The internal patch version suffix version'
required: true
default: 1
type: number
env:
VERSION: ${{ inputs.solr_version }}
VERSION_SUFFIX: otto-de.${{ inputs.patch_version }}
VERSION_FULL: ${{ inputs.solr_version }}-otto-de.${{ inputs.patch_version }}
jobs:
maven:
name: Build and release Maven artifacts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 11
java-package: jdk
- uses: actions/cache@v4
with:
path: |
~/.gradle/caches
solr/distribution/build/release/maven
key: ${{ runner.os }}-gradle-release-${{ hashFiles('versions.lock') }}
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Gradle assemble release
run: ./gradlew assembleRelease -Dversion.release=${{ env.VERSION_FULL }}
- name: Upload artifacts to GitHub Package Repository
run: |
for artifact_id in `ls -1 ${MAVEN_ARTIFACTS}`; do
echo "Uploading ${artifact_id} to GitHub Package Repository ..."
export MAVEN_RELEASE_JARS="${MAVEN_ARTIFACTS}/${artifact_id}/${VERSION_FULL}"
mvn org.apache.maven.plugins:maven-deploy-plugin:3.1.1:deploy-file \
-Durl=https://maven.pkg.github.com/${{ github.repository }} \
-DrepositoryId=github \
-Dfile=${MAVEN_RELEASE_JARS}/${artifact_id}-${VERSION_FULL}.jar \
-DpomFile=${MAVEN_RELEASE_JARS}/${artifact_id}-${VERSION_FULL}.pom \
-Dfiles=${MAVEN_RELEASE_JARS}/${artifact_id}-${VERSION_FULL}-sources.jar,${MAVEN_RELEASE_JARS}/${artifact_id}-${VERSION_FULL}-javadoc.jar \
-Dclassifiers=sources,javadoc \
-Dtypes=jar,jar
done
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_ARTIFACTS: solr/distribution/build/release/maven/org/apache/solr
docker:
name: Build and release Docker images
runs-on: ubuntu-latest
needs: maven
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Docker Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.gradle/caches
solr/distribution/build/release/maven
key: ${{ runner.os }}-gradle-release-${{ hashFiles('versions.lock') }}
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Gradle pre-build Docker image
run: ./gradlew solr:docker:docker -Dversion.release=${{ env.VERSION_FULL }} -Dmanifest.username=${{ github.actor }}
env:
SOLR_DOCKER_IMAGE_REPO: ${{ github.repository }}
SOLR_DOCKER_IMAGE_TAG: ${{ env.VERSION }}
SOLR_DOCKER_BASE_IMAGE: eclipse-temurin:21-jre-jammy
SOLR_DOCKER_DIST: full
- name: Prepare multi-arch Docker build
run: |
mkdir -p solr/packaging/build/distributions/context
tar xzvf solr/packaging/build/distributions/solr-${VERSION_FULL}.tgz \
-C solr/packaging/build/distributions/context
- name: Build and push to DockerHub registry
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
push: true
file: solr/packaging/build/distributions/context/solr-${{ env.VERSION_FULL }}/docker/Dockerfile
context: solr/packaging/build/distributions/context
tags: |
ghcr.io/${{ github.repository }}:${{ env.VERSION }}
ghcr.io/${{ github.repository }}:${{ env.VERSION_FULL }}
release:
name: create release in GitHub
runs-on: ubuntu-latest
needs: docker
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.gradle/caches
solr/distribution/build/release/maven
key: ${{ runner.os }}-gradle-release-${{ hashFiles('versions.lock') }}
- name: Create tag
uses: rickstaa/action-create-tag@v1
with:
tag: ${{ env.VERSION_FULL }}
tag_exists_error: false
message: |
Apache Solr custom release ${{ env.VERSION_FULL }}
- name: Create Release
uses: ncipollo/release-action@v1
with:
tag: ${{ env.VERSION_FULL }}
body: |
Apache Solr custom release ${{ env.VERSION_FULL }}
allowUpdates: true
artifacts: solr/distribution/build/release/maven/**/*.jar,solr/distribution/build/release/maven/**/*.pom
replacesArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}