Skip to content

Fix publishing workflow #15

Fix publishing workflow

Fix publishing workflow #15

Workflow file for this run

name: Java CI with Gradle
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
inputs:
release_description:
description: "Description for the release"
required: true
default: "No description provided."
release_version:
description: "Version"
required: true
default: "No version provided."
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
- name: Build with Gradle Wrapper
run: chmod +x gradlew && ./gradlew build
- name: Upload Build Artifact
uses: actions/upload-artifact@v3
with:
name: gradle-output
path: build/libs/
dependency-submission:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Generate and submit dependency graph
uses: gradle/actions/dependency-submission@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
publish-artifact:
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582
- name: Build with Gradle Wrapper
run: chmod +x gradlew && ./gradlew build
- name: Upload Build Artifact
uses: actions/upload-artifact@v3
with:
name: gradle-output
path: build/libs/
- name: Create GitHub Release
uses: actions/create-release@v1
with:
tag_name: manual-release-${{ github.run_id }}
release_name: "Release v${{ github.event.inputs.release_version }}"
body: ${{ github.event.inputs.release_description }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}