Skip to content

release

release #7

Workflow file for this run

# MIT License
#
# Copyright (c) 2021 - 2024 ViliusSutkus89.com
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
name: release
on:
workflow_dispatch:
inputs:
gradle_publish:
description: Publish to Sonatype
type: boolean
default: true
github_release:
description: Create a GitHub release
type: boolean
default: true
version_increment:
description: Increment version
type: boolean
default: true
permissions:
actions: none
checks: none
contents: write
deployments: none
issues: none
packages: none
pull-requests: none
repository-projects: none
security-events: none
statuses: none
jobs:
releaseSonatype:
environment: LibraryKeyAndSonatypeAccess
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
# A branch is required for post release version increment commit
ref: ${{ github.event.ref }}
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- uses: android-actions/setup-android@v3
- name: setup python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: install python dependencies
run: pip install --upgrade conan
- run: |
conan config install .github/conan
conan profile list
conan profile show
- run: conan remote add odr https://artifactory.opendocument.app/artifactory/api/conan/conan
- run: conan graph info wvWare --profile=android-21-armv8 --build=missing --format=html > conangraph.html
- run: ./gradlew lintRelease publishToMavenLocal
- run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository --no-configuration-cache
if: ${{ github.event.inputs.gradle_publish == 'true' }}
env:
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASS: ${{ secrets.SIGNING_PASS }}
- run: ./ci-scripts/updateDownstreamVersion
id: updateDownstreamVersion
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Update version in README.md (${{ steps.updateDownstreamVersion.outputs.version }})"
file_pattern: ${{ steps.updateDownstreamVersion.outputs.files }}
- name: Create GitHub Release
if: ${{ github.event.inputs.github_release == 'true' }}
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: "v${{ steps.updateDownstreamVersion.outputs.version }}"
name: "${{ github.event.repository.name }} v${{ steps.updateDownstreamVersion.outputs.version }}"
bodyFile: "UpcomingReleaseNotes.md"
- run: ./ci-scripts/incrementVersion --patch
id: postReleaseVersionIncrement
- uses: stefanzweifel/git-auto-commit-action@v5
if: ${{ github.event.inputs.version_increment == 'true' }}
with:
commit_message: "Post release library version increment to ${{ steps.postReleaseVersionIncrement.outputs.newVersion }} (from ${{ steps.postReleaseVersionIncrement.outputs.oldVersion }})"
file_pattern: ${{ steps.postReleaseVersionIncrement.outputs.files }}
- run: echo -n > UpcomingReleaseNotes.md
- uses: stefanzweifel/git-auto-commit-action@v5
if: ${{ github.event.inputs.github_release == 'true' }}
with:
commit_message: "Post release truncation of UpcomingReleaseNotes.md"
file_pattern: UpcomingReleaseNotes.md