Skip to content

release(symmetric): 0.1.1 #67

release(symmetric): 0.1.1

release(symmetric): 0.1.1 #67

Workflow file for this run

name: release
on:
push:
tags:
- "**"
env:
GRADLE_OPTS: -Dorg.gradle.jvmargs="-XX:MaxMetaspaceSize=2g"
JDK_VERSION: 19
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
outputs:
module_name: ${{ steps.module.outputs.module_name }}
steps:
- uses: actions/checkout@v3
- name: Set up JDK ${{ env.JDK_VERSION }}
uses: actions/setup-java@v3
with:
java-version: ${{ env.JDK_VERSION }}
distribution: temurin
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Save tag prefix to github env
id: module
run: echo "module_name=$(echo $GITHUB_REF_NAME | cut -d'/' -f1)" >> $GITHUB_OUTPUT
- uses: gradle/gradle-build-action@v2
- name: remove SNAPSHOT suffix on kipher-core version
if: ${{ steps.module.outputs.module_name }} != "kipher-core"
run: |
cd kipher-core
sed -i '/^VERSION=/ s/-SNAPSHOT//' gradle.properties
- name: remove SNAPSHOT on gradle.properties version
run: |
cd ${{ steps.module.outputs.module_name }}
sed -i '/^VERSION=/ s/-SNAPSHOT//' gradle.properties
- name: remove SNAPSHOT on root gradle.properties
run: sed -i '/^VERSION=/ s/-SNAPSHOT//' gradle.properties
- name: Get version from gradle.properties
id: version_name
shell: bash
run: |
cd ${{ steps.module.outputs.module_name }}
echo "version=$(grep '^VERSION=' gradle.properties | cut -d'=' -f2)" >> $GITHUB_OUTPUT
- name: Gradle build
run: ./gradlew ${{ steps.module.outputs.module_name }}:clean ${{ steps.module.outputs.module_name }}:build --scan
- name: Publish module on GPR
run: ./gradlew ${{ steps.module.outputs.module_name }}:publishAllPublicationsToGitHubPackagesRepository
- name: Publish module on Sonatype
run: ./gradlew ${{ steps.module.outputs.module_name }}:publishToSonatype
env:
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
SONATYPE_PASS: ${{ secrets.SONATYPE_PASS }}
- name: Publish module on Sonatype (Phase 2)
run: ./gradlew findSonatypeStagingRepository closeSonatypeStagingRepository
env:
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
SONATYPE_PASS: ${{ secrets.SONATYPE_PASS }}
- name: Get Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
validation_level: warn
version: ${{ steps.version_name.outputs.version }}
path: docs/CHANGELOG-${{ steps.module.outputs.module_name }}.md
- name: Create release
uses: ncipollo/release-action@v1
if: startsWith(github.ref, 'refs/tags/')
with:
tag: ${{ steps.module.outputs.module_name }}/${{ steps.changelog_reader.outputs.version }}
name: ${{ steps.module.outputs.module_name }} v${{ steps.changelog_reader.outputs.version }}
body: ${{ steps.changelog_reader.outputs.changes }}
prerelease: ${{ steps.changelog_reader.outputs.status == 'prerelease' }}
draft: ${{ steps.changelog_reader.outputs.status == 'unreleased' }}
allowUpdates: true
artifactErrorsFailBuild: false
artifacts: |
${{ steps.module.outputs.module_name }}/build/libs/*
docs:
needs: [ publish ]
uses: ./.github/workflows/docs.yml
with:
project: ${{ needs.publish.outputs.module_name }}
secrets: inherit