Skip to content

Publish a new Release #64

Publish a new Release

Publish a new Release #64

Workflow file for this run

name: publish
on:
push:
tags:
- '3.*'
workflow_dispatch:
inputs:
tag:
required: true
type: string
description: 'Tag to use for the release and changelog'
concurrency:
group: "publish"
cancel-in-progress: true
jobs:
publish:
runs-on: macos-latest
environment: publishing
steps:
- uses: actions/checkout@v4
- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
- name: set up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
check-latest: true
java-version: 21
cache: 'gradle'
- name: Validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest
- name: Create local properties
env:
LOCAL_PROPERTIES: ${{ secrets.LOCAL_PROPERTIES }}
run: echo "$LOCAL_PROPERTIES" | base64 --decode > local.properties
- name: Assemble android sample
run: ./gradlew :sample:assembleRelease
- name: Publish to sonatype
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
# It's important to not upload in parallel or duplicate repos will be created
# repository creds are broken with gradle 8.6 https://github.com/gradle/gradle/issues/24040
run: ./gradlew publishAllPublicationsToSonatypeRepository -Dorg.gradle.parallel=false --stacktrace --no-configuration-cache
- name: Generate Changelog
uses: mikepenz/release-changelog-builder-action@v4
id: build_changelog
with:
commitMode: true
configurationJson: |
{
"template": "#{{CHANGELOG}}",
"pr_template": "- #{{TITLE}}",
"trim_values": false,
"categories": [
{
"title": "## New Features",
"labels": ["feat", "feature"]
},
{
"title": "## Bug Fixes",
"labels": ["fix", "bug"]
},
{
"title": "## Other",
"labels": []
},
{
"title": "## Docs",
"labels": ["doc", "docs"]
}
],
"label_extractor": [
{
"pattern": "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\\([\\w\\-\\.]+\\))?(!)?: ([\\w ])+([\\s\\S]*)",
"target": "$1"
}
]
}
- name: Create GH release
uses: ncipollo/release-action@v1.14.0
id: create_release
with:
draft: true
artifactErrorsFailBuild: true
prerelease: false
artifacts: sample/build/outputs/apk/release/pro.respawn.flowmvi.sample.apk
body: ${{steps.build_changelog.outputs.changelog}}
env:
GITHUB_TOKEN: ${{ github.token }}