-
Notifications
You must be signed in to change notification settings - Fork 36
47 lines (40 loc) · 1.2 KB
/
build-and-publish.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
name: Build and publish artifacts
on:
push:
branches:
- master
tags:
- "v*"
permissions:
contents: write # Required to create releases and modify repository contents
deployments: write # Required for creating deployments associated with releases
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: "adopt"
java-version: 8
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Build with Gradle
run: ./gradlew jar
# https://github.com/marketplace/actions/create-release
#
# This will only get triggered when creating a tag, such as via the
# commands:
#
# git tag -a v0.0.1 && git push origin v0.0.1
#
# For good measure, tags should be signed with your GPG key, such as:
#
# git tag -s -a v0.0.1 && git push origin v0.0.1
- uses: ncipollo/release-action@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
artifacts: "build/libs/*.jar"
bodyFile: ".github/workflows/release-body.md"