Skip to content

Commit

Permalink
ci: Add release-please (#3)
Browse files Browse the repository at this point in the history
ci: Add release / publish script
  • Loading branch information
thelukewalton authored Oct 18, 2024
1 parent bd3e97b commit 7cd4d9f
Show file tree
Hide file tree
Showing 7 changed files with 127 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @benken @thelukewalton
18 changes: 18 additions & 0 deletions .github/workflows/on-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: CI - On Main
on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
release-type: java
32 changes: 32 additions & 0 deletions .github/workflows/on-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CI - On Release
on:
workflow_dispatch:
release:
types: [released]

jobs:
Artifact:
runs-on: ubuntu-latest
permissions:
id-token: write
environment: artifactory
env:
username: ${{ secrets.ARTIFACTORY_USERNAME }}
password: ${{ secrets.ARTIFACTORY_PASSWORD }}
zds-android-maven: ${{ secrets.ZDS_ANDROID_MAVEN }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Add environment variables
run: |
echo "username=${{secrets.ARTIFACTORY_USERNAME}}" >> gradle.properties
echo "password=${{secrets.ARTIFACTORY_PASSWORD}}" >> gradle.properties
echo "zds-android-maven=${{secrets.ZDS_ANDROID_MAVEN}}" >> gradle.properties
- name: Publish
run: gradle publish -P publish=rel
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "1.0.0"
}
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,16 @@ dependencyResolutionManagement {

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

<!-- x-release-please-start-version -->

```
dependencies {
...
implementation 'com.zebra:zds:1.0.0'
}
```

<!-- x-release-please-end -->

Once this is added, your IDE should

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.
Expand Down
2 changes: 2 additions & 0 deletions components/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ publishing {
release(MavenPublication) {
groupId = 'com.zebra'
artifactId = 'zds'
// x-release-please-start-version
version = '1.0.0'
// x-release-please-end

afterEvaluate {
from components.release
Expand Down
67 changes: 67 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"packages": {
".": {
"release-type": "simple"
}
},
"include-component-in-tag": false,
"extra-files": [
"README.md",
"components/build.gradle"
],
"changelog-sections": [
{
"type": "feat",
"section": "✨ New Features"
},
{
"type": "fix",
"section": "🪲 Bug Fixes"
},
{
"type": "revert",
"section": "👀 Reverts"
},
{
"type": "docs",
"section": "📈 Documentation"
},
{
"type": "deps",
"section": "⛓️ Dependencies"
},
{
"type": "test",
"section": "🧪 Tests"
},
{
"type": "chore",
"section": "🧹 Miscellaneous Chores"
},
{
"type": "perf",
"section": "Performance Improvements",
"hidden": true
},
{
"type": "refactor",
"section": "Code Refactoring",
"hidden": true
},
{
"type": "style",
"section": "Styles",
"hidden": true
},
{
"type": "build",
"section": "Build System",
"hidden": true
},
{
"type": "ci",
"section": "Continuous Integration",
"hidden": true
}
]
}

0 comments on commit 7cd4d9f

Please sign in to comment.