-
Notifications
You must be signed in to change notification settings - Fork 8
50 lines (48 loc) · 1.58 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
name: Release
on:
release:
types: [ published ]
jobs:
prepare:
runs-on: ubuntu-latest
steps:
# Assume that input tag is formatted like 'v1.2.3' and transforms that to '1.2.3'
- name: Normalize version
id: normalize-version
uses: actions/github-script@v5
with:
result-encoding: string
script: |
const tagName = context.payload.release.tag_name;
if (tagName.startsWith("v")) {
const version = tagName.substring(1);
console.log(`Setting version to ${version}`);
core.setOutput('version', version);
} else {
core.setFailed(`Release tag ${tagName} does not have a prefix 'v'`);
}
outputs:
version: ${{ steps.normalize-version.outputs.version }}
# TODO: duplication from build.yaml
build:
needs: [ prepare ]
runs-on: ubuntu-latest
strategy:
matrix:
elasticsearchVersion: ['8.11.1', '8.5.3']
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 17
- uses: gradle/wrapper-validation-action@v1
- uses: gradle/gradle-build-action@v2
with:
arguments: build -DbaseVersion=${{ needs.prepare.outputs.version }} -DelasticsearchVersion=${{ matrix.elasticsearchVersion }}
- name: Upload the artifacts
uses: skx/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: 'build/distributions/*.zip'