Skip to content

Commit 7cd4d9f

Browse files
ci: Add release-please (#3)
ci: Add release / publish script
1 parent bd3e97b commit 7cd4d9f

7 files changed

+127
-1
lines changed

.github/CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @benken @thelukewalton

.github/workflows/on-main.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: CI - On Main
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
release-please:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: googleapis/release-please-action@v4
16+
with:
17+
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
18+
release-type: java

.github/workflows/on-release.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: CI - On Release
2+
on:
3+
workflow_dispatch:
4+
release:
5+
types: [released]
6+
7+
jobs:
8+
Artifact:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
id-token: write
12+
environment: artifactory
13+
env:
14+
username: ${{ secrets.ARTIFACTORY_USERNAME }}
15+
password: ${{ secrets.ARTIFACTORY_PASSWORD }}
16+
zds-android-maven: ${{ secrets.ZDS_ANDROID_MAVEN }}
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: actions/setup-java@v4
20+
with:
21+
distribution: temurin
22+
java-version: 17
23+
- name: Setup Gradle
24+
uses: gradle/actions/setup-gradle@v4
25+
- name: Add environment variables
26+
run: |
27+
echo "username=${{secrets.ARTIFACTORY_USERNAME}}" >> gradle.properties
28+
echo "password=${{secrets.ARTIFACTORY_PASSWORD}}" >> gradle.properties
29+
echo "zds-android-maven=${{secrets.ZDS_ANDROID_MAVEN}}" >> gradle.properties
30+
31+
- name: Publish
32+
run: gradle publish -P publish=rel

.release-please-manifest.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "1.0.0"
3+
}

README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,16 @@ dependencyResolutionManagement {
3535

3636
2. Add dependency to **app-level** `build.gradle`
3737

38+
<!-- x-release-please-start-version -->
39+
3840
```
3941
dependencies {
40-
...
4142
implementation 'com.zebra:zds:1.0.0'
4243
}
4344
```
4445

46+
<!-- x-release-please-end -->
47+
4548
Once this is added, your IDE should
4649

4750
3. For the components to work and receive the correct theme values, we must add the theme n `AndroidManifest.xml`. Be sure to remove other themes which could override this and prevent the components from working.

components/build.gradle

+2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ publishing {
4343
release(MavenPublication) {
4444
groupId = 'com.zebra'
4545
artifactId = 'zds'
46+
// x-release-please-start-version
4647
version = '1.0.0'
48+
// x-release-please-end
4749

4850
afterEvaluate {
4951
from components.release

release-please-config.json

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{
2+
"packages": {
3+
".": {
4+
"release-type": "simple"
5+
}
6+
},
7+
"include-component-in-tag": false,
8+
"extra-files": [
9+
"README.md",
10+
"components/build.gradle"
11+
],
12+
"changelog-sections": [
13+
{
14+
"type": "feat",
15+
"section": "✨ New Features"
16+
},
17+
{
18+
"type": "fix",
19+
"section": "🪲 Bug Fixes"
20+
},
21+
{
22+
"type": "revert",
23+
"section": "👀 Reverts"
24+
},
25+
{
26+
"type": "docs",
27+
"section": "📈 Documentation"
28+
},
29+
{
30+
"type": "deps",
31+
"section": "⛓️ Dependencies"
32+
},
33+
{
34+
"type": "test",
35+
"section": "🧪 Tests"
36+
},
37+
{
38+
"type": "chore",
39+
"section": "🧹 Miscellaneous Chores"
40+
},
41+
{
42+
"type": "perf",
43+
"section": "Performance Improvements",
44+
"hidden": true
45+
},
46+
{
47+
"type": "refactor",
48+
"section": "Code Refactoring",
49+
"hidden": true
50+
},
51+
{
52+
"type": "style",
53+
"section": "Styles",
54+
"hidden": true
55+
},
56+
{
57+
"type": "build",
58+
"section": "Build System",
59+
"hidden": true
60+
},
61+
{
62+
"type": "ci",
63+
"section": "Continuous Integration",
64+
"hidden": true
65+
}
66+
]
67+
}

0 commit comments

Comments
 (0)