-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (91 loc) · 3.68 KB
/
release.yml
File metadata and controls
105 lines (91 loc) · 3.68 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
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: DataTracks JavaTracks Release
on:
workflow_dispatch:
inputs:
tag_name:
description: 'The Git tag for the release (e.g., v1.0.0, v1.2.3-beta)'
required: true
type: string
release_name:
description: 'The name of the release (defaults to tag_name)'
required: false
type: string
default: '' # Will be handled in the step if not provided
release_body:
description: 'Custom release notes content'
required: false
type: string
default: |
## Release Notes
This release was manually triggered.
Please provide detailed notes for future releases!
draft:
description: 'Create a draft release (true/false)'
required: false
type: boolean
default: false
prerelease:
description: 'Mark as a pre-release (true/false)'
required: false
type: boolean
default: false
permissions:
contents: write # Required to create/update releases and upload release assets
jobs:
create_release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Important: Fetch all history to generate changelog if needed
submodules: 'true'
# Optional: Build your library artifacts here if you want to attach them to the release
# For example, if you have a Gradle project:
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build artifacts
run: ./gradlew clean build -x test # This will create your JARs in build/libs/
# --- DEBUGGING STEP 1: Show current working directory ---
- name: Show current working directory
run: pwd
# --- DEBUGGING STEP 2: List contents of the build directory ---
- name: List contents of build directory
run: ls -l build/
# --- DEBUGGING STEP 3: Recursively list contents of build/libs and check for JARs ---
- name: List contents of build/libs (and check for JARs)
run: |
echo "Listing contents of $(pwd)/build/libs/:"
ls -lR build/libs/ # -R for recursive, -l for long listing
echo "---"
echo "Searching for JAR files:"
find build/libs -name "*.jar" # Find all .jar files in build/libs recursively
echo "---"
find build/libs -maxdepth 1 -name "*.jar" # Find .jar files directly in build/libs (not subdirs)
continue-on-error: true # Allow workflow to continue even if this fails, for debugging purposes
# --- This is the core step for creating the GitHub Release ---
- name: Create GitHub Release
id: create_release
uses: softprops/action-gh-release@v2
with:
# Use the tag name provided via workflow_dispatch input
tag_name: ${{ github.event.inputs.tag_name }}
# Use the release name input, or fallback to tag_name if not provided
name: ${{ github.event.inputs.release_name || format('Release {0}', github.event.inputs.tag_name) }}
# Use the release body input
body: ${{ github.event.inputs.release_body }}
# Use the draft input
draft: ${{ github.event.inputs.draft }}
# Use the prerelease input
prerelease: ${{ github.event.inputs.prerelease }}
# Optional: Upload your built artifacts as release assets
files: |
build/libs/javatracks.jar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}