-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (69 loc) · 1.73 KB
/
ci.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: CI
on:
push:
paths:
- 'gradle/**/*'
- 'gradle*'
- 'src/**/*'
- '*.gradle.kts'
- 'gradle.properties'
- '.github/workflows/*.yml'
branches:
- '**'
tags:
- '*.*.*'
workflow_dispatch:
env:
ARTIFACT_NAME: progression
jobs:
build:
name: Build
runs-on: ubuntu-22.04
permissions:
contents: read
packages: read
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
- name: Set Gradle permissions
run: chmod +x gradlew
- name: Build project
uses: gradle/gradle-build-action@v3
env:
GHPKG_USER: ${{ github.repository_owner }}
GHPKG_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
arguments: build
cache-disabled: true
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
path: build/libs/*.jar
release:
name: Release
runs-on: ubuntu-22.04
needs: build
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
permissions:
contents: write
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
path: artifact
- name: Create draft release
uses: softprops/action-gh-release@v1
with:
draft: true
tag_name: ${{ github.ref_name }}
files: artifact/*.jar
token: ${{ secrets.GITHUB_TOKEN }}