forked from gocd/gocd-ldap-authorization-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (42 loc) · 1.54 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
47
# 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: Create Stable Release
on:
push:
tags:
- '*'
jobs:
build_and_release:
runs-on: ubuntu-latest
env:
GITHUB_USER: "gocd"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
PRERELEASE: "${{ github.event.inputs.prerelease }}"
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: 13
- name: Release
run: ./gradlew clean check assemble
- name: Set the value
id: get_version
run: |
echo "plugin_version=$(ls ./build/libs/gocd-ldap-authorization-plugin-*.jar | cut -c 45- | rev | cut -c 5- | rev)" >> $GITHUB_ENV
- name: 'Upload Artifact'
uses: actions/upload-artifact@v2
with:
name: gocd-ldap-authorization-plugin-${{ env.plugin_version }}.jar
path: build/libs/gocd-ldap-authorization-plugin-${{ env.plugin_version }}.jar
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/libs/gocd-ldap-authorization-plugin-${{ env.plugin_version }}.jar
asset_name: gocd-ldap-authorization-plugin-${{ env.plugin_version }}.jar
tag: ${{ github.ref }}
overwrite: true