Skip to content

Commit

Permalink
buildscript: configure publication with correct parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
TheElan committed Dec 13, 2021
1 parent e17120f commit 659ad05
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@ jobs:
echo "REPOSITORY_NAME=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
- name: Publish package
run: ./gradlew publish -Pgroup=com.github."$REPOISITORY_OWNER" -Pversion=0.0.1-publish-test
run: ./gradlew publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GROUP_ID: com.github.${{ env.REPOSITORY_NAME }}
ARTIFACT_NAME: "${{ env.REPOSITORY_NAME }}"
ARTIFACT_VERSION: "0.0.1-publish-test"
REPOSITORY_NAME: "${{ env.REPOSITORY_NAME }}"
REPOSITORY_OWNER: "${{ env.REPOSITORY_OWNER }}"

Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/release-tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ jobs:
echo "REPOSITORY_NAME=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
- name: Publish package
run: ./gradlew publish -Pgroup=com.github."$REPOSITORY_OWNER" -Pversion="$VERSION"
run: ./gradlew publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPOSITORY_NAME: "${{ env.REPOSITORY_NAME }}"
REPOSITORY_OWNER: "${{ env.REPOSITORY_OWNER }}"
VERSION: "${{ env.RELEASE_VERSION }}"
GROUP_ID: com.github.${{ env.REPOSITORY_NAME }}
REPOSITORY_NAME: "${{ env.REPOSITORY_NAME }}"
ARTIFACT_NAME: "${{ env.REPOSITORY_NAME }}"
ARTIFACT_VERSION: "${{ env.RELEASE_VERSION }}"
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,10 @@ publishing {
if (apiPackage) {
archives source: apiJar, classifier: "api"
}

groupId = System.getenv("GROUP_ID") ?: group
artifactId = System.getenv("ARTIFACT_NAME") ?: project.name
version = System.getenv("ARTIFACT_VERSION") ?: project.version
}
}

Expand Down

0 comments on commit 659ad05

Please sign in to comment.