-
Notifications
You must be signed in to change notification settings - Fork 11
139 lines (139 loc) · 5.46 KB
/
Copy pathrelease-sdk.yml
File metadata and controls
139 lines (139 loc) · 5.46 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: Release
on:
push:
branches: [ master ]
jobs:
release-sdk:
runs-on: macos-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: set up JDK 17
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
cache: gradle
- name: Build
run: ./gradlew cmplibrary:build
- name: Get current time
id: current-time
run: |
echo "formattedTime=$(date +"(%B, %d, %Y)")" >> $GITHUB_OUTPUT
- name: Set version lib into VERSION_NAME variable
run: |
./gradlew cmplibrary:versionTxt
echo "VERSION_NAME=$(cat app/version.txt)" >> $GITHUB_ENV
- name: Update CHANGELOG.md
run: ./gradlew cmplibrary:changeLogUpdate
- name: Update README.md
run: ./gradlew cmplibrary:replaceInFile
- name: Read Release Note
id: release_note
run: |
echo 'content<<EOF' >> $GITHUB_OUTPUT
if [ -f ./cmplibrary/release_note.txt ]; then
cat ./cmplibrary/release_note.txt >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
else
echo "No release note found" >> $GITHUB_OUTPUT
fi
echo 'EOF' >> $GITHUB_OUTPUT
- name: Get the version
id: get_version
run: |
if [ -f ./cmplibrary/version.txt ]; then
echo "content=$(cat ./cmplibrary/version.txt | tr -d '\n')" >> $GITHUB_OUTPUT
else
echo "content=$GITHUB_REF_NAME" >> $GITHUB_OUTPUT
fi
- run: ./gradlew publish --no-parallel --no-configuration-cache
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.ORG_GRADLE_PROJECT_mavenCentralUsername }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.ORG_GRADLE_PROJECT_mavenCentralPassword }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.ORG_GRADLE_PROJECT_signingInMemoryKeyId }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.ORG_GRADLE_PROJECT_signingInMemoryKeyPassword }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ORG_GRADLE_PROJECT_signingInMemoryKey }}
- name: Add, commit and push edited files
env:
GIT_USERNAME: ${{ secrets.GIT_USERNAME }}
GIT_EMAIL: ${{ secrets.GIT_EMAIL }}
run: ./gradlew addCommitPush
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: v${{ steps.get_version.outputs.content }}
release_name: v${{ steps.get_version.outputs.content }}
body: |
## ${{ steps.get_version.outputs.content }} ${{ steps.current-time.outputs.formattedTime }}
${{ steps.release_note.outputs.content }}
draft: false
prerelease: false
# release-metaapp:
# runs-on: ubuntu-latest
# permissions:
# contents: write
# steps:
# - uses: actions/checkout@v4
# - name: set up JDK 17
# uses: actions/setup-java@v4
# with:
# distribution: zulu
# java-version: 17
# cache: gradle
# - name: Bump versionCode
# id: bump
# run: |
# git config user.email "andre@sourcepoint.com"
# git config user.name "GitHub Action"
# ./gradlew metaapp:bumpVersionCode
# - name: creating local.properties
# run: touch local.properties
# - name: generating MetaApp build release
# id: buildRelease
# run: ./gradlew :metaapp:bundleRelease :metaapp:bundleDebug :metaapp:assembleRelease :metaapp:assembleDebug
# - name: Sign APK
# id: sign
# # uses v1 tag of r0adkll/sign-android-release as of 2025-04-15
# uses: r0adkll/sign-android-release@349ebdef58775b1e0d8099458af0816dc79b6407
# with:
# releaseDirectory: samples/metaapp/build/outputs/bundle/release
# signingKeyBase64: ${{ secrets.SIGNING_KEY }}
# alias: ${{ secrets.SIGNING_ALIAS }}
# keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
# keyPassword: ${{ secrets.KEY_ALIAS_PASSWORD }}
# - name: Create service_account.json
# id: createServiceAccount
# run: |
# echo '${{ secrets.SERVICE_ACCOUNT_JSON }}' > service_account.json
# - name: 'Publish release artifact'
# if: always()
# uses: actions/upload-artifact@v4
# with:
# name: 'release-artifact'
# path: ${{ steps.sign.outputs.signedReleaseFile }}
# - name: Deploy to Play Store
# id: deploy
# # uses v1.0.15 tag of r0adkll/upload-google-play as of 2025-04-15
# uses: r0adkll/upload-google-play@9745ef904e395471bca5696056a6ce8a60d18cf8
# with:
# serviceAccountJson: service_account.json
# packageName: com.sourcepointmeta.metaapp
# releaseFiles: ${{ steps.sign.outputs.signedReleaseFile }}
# track: production
# - name: Add, commit and push edited files
# env:
# GIT_USERNAME: ${{ secrets.GIT_USERNAME }}
# GIT_EMAIL: ${{ secrets.GIT_EMAIL }}
# run: ./gradlew addCommitPush
# - name: Publish MetaAppDebug artifact
# if: always()
# uses: actions/upload-artifact@v4
# with:
# name: MetaAppDebug
# path: samples/metaapp/build/outputs/apk/debug/metaapp-debug.apk