-
Notifications
You must be signed in to change notification settings - Fork 8
92 lines (90 loc) · 2.84 KB
/
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
name: "Build Cassandra-Stress"
permissions:
contents: write
on:
workflow_dispatch:
inputs:
version:
required: false
description: 'Version of the release'
latest:
required: false
default: false
description: 'Build latest version'
workflow_call:
inputs:
version:
required: false
description: 'Version of the release'
type: string
latest:
required: false
default: false
type: boolean
description: 'Build latest version'
jobs:
build:
strategy:
matrix:
java: [ '11' ]
os: [ 'ubuntu-latest' ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: ${{ matrix.java }}
- name: Setup Ant
uses: cedx/setup-ant@v2
with:
optional-tasks: true
version: latest
- name: Build with version ${{ inputs.version }}
if: ${{ inputs.version != '' }}
run: ant -Dversion=${{ inputs.version }} -Drelease=true jar
- name: Build latest
if: ${{ inputs.version == '' }}
run: |
ant init
ant jar
- name: Artifacts
if: ${{ inputs.version != '' }}
run: ant -Dversion=${{ inputs.version }} -Drelease=true artifacts
- name: Release
uses: softprops/action-gh-release@v2
id: release
if: ${{ inputs.version != '' }}
with:
make_latest: ${{ inputs.latest }}
name: "v${{ inputs.version }}"
tag_name: "v${{ inputs.version }}"
generate_release_notes: true
append_body: true
prerelease: false
fail_on_unmatched_files: true
files: |
build/cassandra-stress-${{ inputs.version }}-bin.tar.gz
build/cassandra-stress-${{ inputs.version }}-bin.tar.gz.sha256
build/cassandra-stress-${{ inputs.version }}-bin.tar.gz.sha512
build/cassandra-stress-${{ inputs.version }}-src.tar.gz
build/cassandra-stress-${{ inputs.version }}-src.tar.gz.sha256
build/cassandra-stress-${{ inputs.version }}-src.tar.gz.sha512
- name: "Generate release changelog"
if: ${{ inputs.version != '' }}
uses: heinrichreimer/action-github-changelog-generator@v2.4
with:
token: ${{ secrets.GITHUB_TOKEN }}
author: true
releaseUrl: ${{ steps.release.outputs.url }}
issues: false
pullRequests: true
- uses: stefanzweifel/git-auto-commit-action@v5
if: ${{ inputs.version != '' }}
with:
commit_message: "Update CHANGELOG.md"
branch: master
commit_options: '--no-verify --signoff'
file_pattern: CHANGELOG.md