Skip to content

Update dependency io.github.gradle-nexus:publish-plugin to v2 (#131) #107

Update dependency io.github.gradle-nexus:publish-plugin to v2 (#131)

Update dependency io.github.gradle-nexus:publish-plugin to v2 (#131) #107

name: Create release
on:
push:
tags:
- 'v*'
branches:
- main
env:
GPG_SEC: ${{ secrets.PGP_SEC }}
GPG_PASSWORD: ${{ secrets.PGP_PASSWORD }}
OSSRH_USERNAME: ${{ secrets.SONATYPE_USER }}
OSSRH_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
jobs:
release:
name: Build release
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# release workflow should have access to all tags
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
- name: Status git before
run: git status
- name: gradle release from tag
# if workflow is triggered after push of a tag, deploy full release
if: ${{ github.ref_type == 'tag' }}
uses: gradle/gradle-build-action@v3
with:
gradle-version: wrapper
arguments: |
publishToSonatype
closeSonatypeStagingRepository
-Prelease
--build-cache
-PgprUser=${{ github.actor }}
-PgprKey=${{ secrets.GITHUB_TOKEN }}
- name: gradle snapshot from branch
# if workflow is triggered after push to a branch, deploy snapshot
if: ${{ github.ref_type == 'branch' }}
uses: gradle/gradle-build-action@v3
with:
gradle-version: wrapper
arguments: |
publishToSonatype
-Preckon.stage=snapshot
-Prelease
--build-cache
-PgprUser=${{ github.actor }}
-PgprKey=${{ secrets.GITHUB_TOKEN }}
- name: Status git after
if: ${{ always() }}
run: git status
github_release:
needs: release
# release is created only for tags
if: ${{ github.ref_type == 'tag' }}
name: Create Github Release
runs-on: ubuntu-latest
steps:
- name: Create Github Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false