-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (41 loc) · 1.28 KB
/
version-release.yml
File metadata and controls
50 lines (41 loc) · 1.28 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
48
49
50
name: Create Release on Version Update
permissions:
contents: write
on:
push:
branches:
- main
jobs:
create_release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '21'
- name: Extract version from build.gradle.kts
id: get_version
run: |
FULL_VERSION=$(grep -oP 'version = "\K[0-9]+\.[0-9]+\.[0-9]+(?:-\w*)?' build.gradle.kts)
echo "FULL_VERSION=$FULL_VERSION" >> $GITHUB_ENV
VERSION=$(grep -oP 'version = "\K[0-9]+\.[0-9]+\.[0-9]+' build.gradle.kts)
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Build with Gradle
run: |
chmod +x ./gradlew
./gradlew shadowJar
- name: Post GitHub Release
uses: svenstaro/upload-release-action@v2
continue-on-error: true
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/libs/*.jar
file_glob: true
asset_name: ${{ github.event.repository.name }}-${{ env.FULL_VERSION }}
tag: v${{ env.FULL_VERSION }}
overwrite: false