Skip to content

Release

Release #152

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
version:
description: a stable version to set in version.txt before publishing (e.g. 0.42.1, without the 'v' prefix)
jobs:
release:
name: Build & Release
permissions:
contents: write
id-token: write
environment: Public Release
runs-on: "ubuntu-latest"
env:
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSPHRASE }}
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.OSSRH_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install Semgrep
run: python3 -m pip install semgrep
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- uses: gradle/gradle-build-action@v2
env:
ORG_GRADLE_PROJECT_codemodderOpenAIKey: ${{ secrets.CODEMODDER_OPENAI_API_KEY }}
with:
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
arguments: --console=plain --quiet --no-configuration-cache -Pversion=${{ inputs.version }} build distZip publishNebulaPublicationToSonatypeRepository closeAndReleaseSonatypeStagingRepository
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ inputs.version }}
release_name: v${{ inputs.version }}
draft: false
prerelease: false
- name: Upload Core Codemods Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./core-codemods/build/distributions/core-codemods-${{ inputs.version }}.zip
asset_name: codemodder-java-codemods-${{ inputs.version }}.zip
asset_content_type: application/zip