-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (83 loc) · 3.38 KB
/
Copy pathrelease.yml
File metadata and controls
101 lines (83 loc) · 3.38 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
name: Release for JitPack
run-name: Release ${{ github.event.inputs.version }} for JitPack
on:
workflow_dispatch:
inputs:
version:
description: 'Release version (e.g., 1.2.0)'
required: true
type: string
release_notes:
description: 'Release notes'
required: false
type: string
default: 'New release'
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
- name: Build with Gradle
run: |
chmod +x ./gradlew
# Pass version as property instead of modifying file
./gradlew clean build -Pversion=${{ github.event.inputs.version }} -x test
echo "Building version ${{ github.event.inputs.version }}"
- name: Run tests
run: ./gradlew test -Pversion=${{ github.event.inputs.version }}
- name: Build JAR artifacts
run: |
./gradlew jar -Pversion=${{ github.event.inputs.version }}
./gradlew androidJar -Pversion=${{ github.event.inputs.version }}
./gradlew jvmJar -Pversion=${{ github.event.inputs.version }}
./gradlew sourcesJar -Pversion=${{ github.event.inputs.version }}
./gradlew javadocJar -Pversion=${{ github.event.inputs.version }}
- name: List built artifacts
run: |
echo "Built artifacts:"
ls -la build/libs/
- name: Create Git tag
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git tag -a "${{ github.event.inputs.version }}" -m "Release ${{ github.event.inputs.version }}"
git push origin "${{ github.event.inputs.version }}"
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.event.inputs.version }}
name: Release ${{ github.event.inputs.version }}
body: |
## Release ${{ github.event.inputs.version }}
${{ github.event.inputs.release_notes }}
### JitPack Usage
Add JitPack repository to your build.gradle:
```gradle
repositories {
maven { url 'https://jitpack.io' }
}
```
Add dependency:
```gradle
dependencies {
implementation 'com.github.unicitynetwork:java-state-transition-sdk:${{ github.event.inputs.version }}'
}
```
### Assets
- Main JAR: `java-state-transition-sdk-${{ github.event.inputs.version }}.jar`
- Android JAR: `java-state-transition-sdk-${{ github.event.inputs.version }}-android.jar`
- JVM JAR: `java-state-transition-sdk-${{ github.event.inputs.version }}-jvm.jar`
- Sources: `java-state-transition-sdk-${{ github.event.inputs.version }}-sources.jar`
- Javadoc: `java-state-transition-sdk-${{ github.event.inputs.version }}-javadoc.jar`
files: |
build/libs/*.jar
draft: false
prerelease: false