From e9f0b484d203cb36bf2a8e3f6c7b8fe00fe49ebd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 9 Jun 2025 05:06:08 +0000 Subject: [PATCH 1/2] Initial plan for issue From 450cc39e2c497738438cfc46042618b73632790b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 9 Jun 2025 05:13:28 +0000 Subject: [PATCH 2/2] Add GitHub Actions workflow for publishing to GitHub Packages Co-authored-by: hossain-khan <99822+hossain-khan@users.noreply.github.com> --- .github/workflows/publish-github-packages.yml | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/publish-github-packages.yml diff --git a/.github/workflows/publish-github-packages.yml b/.github/workflows/publish-github-packages.yml new file mode 100644 index 0000000..f6d9bd6 --- /dev/null +++ b/.github/workflows/publish-github-packages.yml @@ -0,0 +1,58 @@ +name: Publish to GitHub Packages + +on: + push: + tags: + - 'v*' # Triggers on version tags like v1.0.0, v2.1.3, etc. + workflow_dispatch: # Allows manual trigger from GitHub Actions UI + +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: '21' # Match the project's Java version requirement (buildSrc needs Java 21) + + - 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 + + # CONFIGURATION REQUIRED: + # The following step publishes to GitHub Packages using credentials. + # No additional setup is needed as the project already has: + # 1. maven-publish plugin configured in lib/build.gradle.kts + # 2. GitHub Packages repository configuration with proper URL + # 3. Authentication using USERNAME and TOKEN environment variables + # + # The GITHUB_TOKEN is automatically provided by GitHub Actions and has + # the necessary permissions to publish packages to the same repository. + # + # If you need to publish to a different repository's packages, you would need to: + # 1. Create a Personal Access Token (PAT) with 'write:packages' permission + # 2. Add it as a repository secret (e.g., PACKAGES_TOKEN) + # 3. Use that secret instead of GITHUB_TOKEN + # + # The current version is hardcoded in lib/build.gradle.kts as "1.0.0" + # For dynamic versioning, consider: + # 1. Using the git tag (${GITHUB_REF#refs/tags/}) + # 2. Reading version from gradle.properties + # 3. Using a gradle plugin like 'axion-release-plugin' + - name: Publish to GitHub Packages + env: + USERNAME: ${{ github.actor }} # GitHub username of the user/bot triggering the workflow + TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub token with packages:write permission + run: ./gradlew publish \ No newline at end of file