-
-
Notifications
You must be signed in to change notification settings - Fork 101
66 lines (54 loc) · 2.24 KB
/
release.yml
File metadata and controls
66 lines (54 loc) · 2.24 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
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: 'temurin'
cache: gradle
- name: Extract version from tag
id: version
run: echo "TAG_VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
- name: Validate version matches libs.versions.toml
run: |
TOML_VERSION=$(grep '^vbpd = ' gradle/libs.versions.toml | sed 's/vbpd = "\(.*\)"/\1/')
if [ "${{ steps.version.outputs.TAG_VERSION }}" != "$TOML_VERSION" ]; then
echo "::error::Tag version (${{ steps.version.outputs.TAG_VERSION }}) does not match libs.versions.toml ($TOML_VERSION)"
exit 1
fi
echo "Version validated: $TOML_VERSION"
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Run checks
run: ./gradlew check --no-configuration-cache
- name: Publish to Maven Central
run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-configuration-cache
env:
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
- name: Build release AARs
run: ./gradlew :vbpd-core:assembleRelease :vbpd:assembleRelease :vbpd-reflection:assembleRelease --no-configuration-cache
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
generate_release_notes: true
files: |
vbpd-core/build/outputs/aar/vbpd-core-release.aar
vbpd/build/outputs/aar/vbpd-release.aar
vbpd-reflection/build/outputs/aar/vbpd-reflection-release.aar