-
Notifications
You must be signed in to change notification settings - Fork 237
47 lines (45 loc) · 1.91 KB
/
Copy pathrelease-drafter.yml
File metadata and controls
47 lines (45 loc) · 1.91 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
name: Release drafter
on:
push:
tags:
- "*"
jobs:
draft-a-release:
name: Draft a release
runs-on: ubuntu-latest
permissions:
issues: write
contents: write
steps:
- name: Checkout code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- id: get_data
run: |
echo "approvers=$(cat .github/CODEOWNERS | grep @ | tr -d '* ' | sed 's/@/,/g' | sed 's/,//1')" >> $GITHUB_OUTPUT
echo "version=$(cat gradle.properties | grep "systemProp.version" | cut -d'=' -f2)" >> $GITHUB_OUTPUT
- uses: trstringer/manual-approval@74d99dff7380e3e4b122d4ededcbca2b6ce59367 # v1
with:
secret: ${{ github.TOKEN }}
approvers: ${{ steps.get_data.outputs.approvers }}
minimum-approvals: 1
issue-title: 'Release opensearch-java : ${{ steps.get_data.outputs.version }}'
issue-body: "Please approve or deny the release of opensearch-java. **VERSION**: ${{ steps.get_data.outputs.version }} **TAG**: ${{ github.ref_name }} **COMMIT**: ${{ github.sha }}"
exclude-workflow-initiator-as-approver: true
- name: Set up JDK 21
uses: actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 # v5
with:
java-version: '21'
distribution: 'temurin'
cache: 'gradle'
- name: Build with Gradle
run: |
export VERSION=`cat gradle.properties | grep "systemProp.version" | tr -d " " | cut -d '=' -f2`
echo Building the version: $VERSION
./gradlew --no-daemon publishPublishMavenPublicationToLocalRepoRepository && tar -C build -cvf artifacts.tar.gz repository
- name: Draft a release
uses: ncipollo/release-action@339a81892b84b4eeb0f6e744e4574d79d0d9b8dd
with:
immutableCreate: true
generateReleaseNotes: true
artifacts: "artifacts.tar.gz"
prerelease: true