Skip to content

Commit 495d50a

Browse files
committed
Update GitHub Actions workflow for release process
This commit updates the GitHub Actions workflow for releasing the Customer Pulse Survey Library. Key changes include: - Updated actions/checkout to v4. - Changed Java setup from JDK 12 to JDK 17 using actions/setup-java@v4 with temurin distribution. - Replaced manual Gradle caching with gradle/actions/setup-gradle@v3. - Modified the AAR build command to `./gradlew :CustomerPulseSurvey:assembleRelease --no-daemon --stacktrace`. - Added a step to list AAR outputs for debugging. - Updated the create release action to softprops/action-gh-release@v2. - Changed `tag_name` and `release_name` to use `github.ref_name`. - Simplified asset uploading by directly specifying files in the `softprops/action-gh-release` action. - Added `workflow_dispatch` trigger. - Added `permissions` block with `contents: write`. - Commented out the optional step for publishing to GitHub Package Registry.
1 parent 0ed567c commit 495d50a

File tree

1 file changed

+34
-36
lines changed

1 file changed

+34
-36
lines changed

.github/workflows/release.yml

Lines changed: 34 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,59 @@
11
name: Release
2+
23
on:
34
push:
45
tags:
56
- 'v*'
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
612
jobs:
713
publish:
814
name: Release Customer Pulse Survey Library
915
runs-on: ubuntu-latest
1016

1117
steps:
12-
- uses: actions/checkout@v1
18+
- uses: actions/checkout@v4
1319

14-
- name: Set up JDK 12
15-
uses: actions/setup-java@v1
20+
- name: Set up JDK 17
21+
uses: actions/setup-java@v4
1622
with:
17-
java-version: 12
23+
distribution: temurin
24+
java-version: '17'
25+
26+
- name: Set up Gradle (with caching)
27+
uses: gradle/actions/setup-gradle@v3
1828

19-
- name: Cache Gradle and wrapper
20-
uses: actions/cache@v2
21-
with:
22-
path: |
23-
~/.gradle/caches
24-
~/.gradle/wrapper
25-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
26-
restore-keys: |
27-
${{ runner.os }}-gradle-
2829
- name: Grant Permission for Gradlew to Execute
2930
run: chmod +x gradlew
3031

32+
# Build only the library module in release
3133
- name: Build AAR ⚙️🛠
32-
run: bash ./gradlew :CustomerPulseSurvey:assemble
33-
34-
#
35-
# - name: Publish to GitHub Package Registry 🚀
36-
# run: bash ./gradlew :CustomerPulseSurvey:publish
37-
# env:
38-
# GPR_USER: ${{ github.actor }}
39-
# GPR_KEY: ${{ secrets.GITHUB_TOKEN }}
40-
#
34+
run: ./gradlew :CustomerPulseSurvey:assembleRelease --no-daemon --stacktrace
35+
36+
# (Optional) show what was produced to help debug paths
37+
- name: List AAR outputs
38+
run: ls -l CustomerPulseSurvey/build/outputs/aar || true
39+
40+
# Create (draft) release
4141
- name: Create Release ✅
4242
id: create_release
43-
uses: actions/create-release@v1
44-
env:
45-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
uses: softprops/action-gh-release@v2
4644
with:
47-
tag_name: ${{ github.ref }}
48-
release_name: ${{ github.ref }}
45+
tag_name: ${{ github.ref_name }}
46+
name: ${{ github.ref_name }}
4947
draft: true
5048
prerelease: false
51-
52-
53-
- name: Upload Customer Pulse Survey Library AAR 🗳
54-
uses: actions/upload-release-asset@v1
49+
files: |
50+
CustomerPulseSurvey/build/outputs/aar/*release*.aar
5551
env:
5652
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57-
with:
58-
upload_url: ${{ steps.create_release.outputs.upload_url }}
59-
asset_path: CustomerPulseSurvey/build/outputs/aar/CustomerPulseSurvey-release.aar
60-
asset_name: customer-pulse-survey.aar
61-
asset_content_type: application/aar
53+
54+
# If you also want to publish to GitHub Packages Maven later:
55+
# - name: Publish to GitHub Package Registry 🚀
56+
# run: ./gradlew :CustomerPulseSurvey:publish --no-daemon --stacktrace
57+
# env:
58+
# GPR_USER: ${{ secrets.GPR_USER }}
59+
# GPR_KEY: ${{ secrets.GPR_KEY }}

0 commit comments

Comments
 (0)