forked from aparo/opensearch-learning-to-rank
-
Notifications
You must be signed in to change notification settings - Fork 16
47 lines (43 loc) · 1.52 KB
/
release.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
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: Tag and publish a release
on:
push:
tags:
- 'v*.*.*'
branches: [ test-release ]
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v2
- name: Set release version Name
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Set up JDK 17.0
uses: actions/setup-java@v1
with:
java-version: 17.0
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew -Dtests.security.manager=false build
- name: Rename build assets
run: mv ./build/distributions/ltr-*.zip ./ltr-plugin-${{ env.RELEASE_VERSION }}.zip
- name: Create Release
id: create_release
uses: ncipollo/release-action@v1
with:
artifacts: "./ltr-plugin-${{ env.RELEASE_VERSION }}.zip"
token: ${{ secrets.GITHUB_TOKEN }}
tag: "release-${{ env.RELEASE_VERSION }}"
- name: Upload Release Asset
id: upload-release-asset
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: "release-${{ env.RELEASE_VERSION }}"
#upload_url: ${{ steps.create_release.outputs.upload_url }}
files: ./ltr-plugin-${{ env.RELEASE_VERSION }}.zip
name: ${{ env.RELEASE_VERSION }}