Skip to content

Release

Release #1392

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
workflow_run:
workflows: [CI]
types:
- completed
permissions:
contents: write
packages: write
deployments: write
issues: write
jobs:
release-drafter:
name: Draft Release
runs-on: ubuntu-latest
outputs:
version: ${{ steps.create_version.outputs.tag_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: release-drafter/release-drafter@v5
id: create_version
release-docker:
needs: [ release-drafter ]
name: Release Docker Images
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
cache: 'gradle'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build
run: ./gradlew check fatJar --no-daemon
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker Metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/markusamshove/natlint
- name: Release Dockerimage
uses: docker/build-push-action@v3
with:
context: .
file: docker/Dockerfile.natlint
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Release Artifacts
uses: ncipollo/release-action@v1
with:
artifacts: 'libs/natls/build/libs/natls.jar,libs/natlint/build/libs/natlint.jar,libs/natqube/build/libs/natqube.jar'
allowUpdates: true
omitBodyDuringUpdate: true
tag: ${{ needs.release_drafter.outputs.version }}
token: ${{ secrets.GITHUB_TOKEN }}
release-maven-central:
name: Release to Maven Central
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
cache: 'gradle'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Publish with Gradle
env:
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.PGP_SECRET }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.PGP_PASSPHRASE }}
run: ./gradlew publishToSonatype --no-daemon
create-issue:
name: Create after Release issue
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: .github/after-release-issue.md