Skip to content

Add Publish to GitHub Packages github workflowΒ #19

@hossain-khan

Description

@hossain-khan

As mentioned in #13 (comment) - there needs to be publish workflow to publish the project to GitHub Packages

Here is earlier suggestion proved.

name: Publish to GitHub Packages

on:
  push:
    tags:
      - 'v*'   # Triggers on version tags like v1.0.0
  workflow_dispatch:  # Allows manual trigger

jobs:
  publish:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Set up JDK
        uses: actions/setup-java@v4
        with:
          distribution: 'temurin'
          java-version: '17'    # Match your project's Java version

      - name: Cache Gradle packages
        uses: actions/cache@v4
        with:
          path: |
            ~/.gradle/caches
            ~/.gradle/wrapper
          key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}

      - name: Grant execute permission for Gradle wrapper
        run: chmod +x ./gradlew

      - name: Publish to GitHub Packages
        env:
          USERNAME: ${{ github.actor }}
          TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: ./gradlew publish

Create the workflow and add inline comments in the workflow on how to setup the configuration needed for this workflow to run.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions