-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[no-jira]
- Loading branch information
Showing
1 changed file
with
36 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
name: Release | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
# tags: | ||
# - '*' | ||
jobs: | ||
release-core: | ||
runs-on: ubuntu-latest | ||
|
@@ -11,37 +11,45 @@ jobs: | |
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.ref }} | ||
- name: Issue a release only if a tag is based on a merged commit in `main` branch | ||
run: | | ||
tag_commit=$(git rev-parse ${{ github.ref }}) | ||
merged_commit=$(git rev-parse main) | ||
if git merge-base --is-ancestor $tag_commit $merged_commit; then | ||
echo "Tag is based on a merged commit in the main branch" | ||
else | ||
echo "Tag is not based on a merged commit in the main branch. Exiting." | ||
exit 0 | ||
fi | ||
- name: Check tag name pattern follows `vX.Y.Z` | ||
run: | | ||
if [[ ! "$GITHUB_REF" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | ||
echo "Tag name does not match the pattern 'vX.Y.Z'. Exiting." | ||
exit 0 | ||
fi | ||
# - name: Issue a release only if a tag is based on a merged commit in `main` branch | ||
# run: | | ||
# tag_commit=$(git rev-parse ${{ github.ref }}) | ||
# merged_commit=$(git rev-parse main) | ||
# | ||
# if git merge-base --is-ancestor $tag_commit $merged_commit; then | ||
# echo "Tag is based on a merged commit in the main branch" | ||
# else | ||
# echo "Tag is not based on a merged commit in the main branch. Exiting." | ||
# exit 0 | ||
# fi | ||
# - name: Check tag name pattern follows `vX.Y.Z` | ||
# run: | | ||
# if [[ ! "$GITHUB_REF" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | ||
# echo "Tag name does not match the pattern 'vX.Y.Z'. Exiting." | ||
# exit 0 | ||
# fi | ||
- name: Setup Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: 17.0.1 | ||
distribution: 'zulu' | ||
- name: Build and test | ||
run: ./gradlew core:build | ||
- name: Publish package | ||
uses: gradle/[email protected] | ||
env: | ||
# https://docs.gradle.org/current/userguide/signing_plugin.html#sec:in-memory-keys | ||
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }} | ||
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }} | ||
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }} | ||
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }} | ||
# - name: Publish package | ||
# uses: gradle/[email protected] | ||
# env: | ||
# # https://docs.gradle.org/current/userguide/signing_plugin.html#sec:in-memory-keys | ||
# ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }} | ||
# ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }} | ||
# ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }} | ||
# ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }} | ||
# with: | ||
# arguments: core:publishAllPublicationsToMavenCentral --no-configuration-cache | ||
|
||
- name: Create GitHub release | ||
uses: softprops/action-gh-release@v1 | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
arguments: core:publishAllPublicationsToMavenCentral --no-configuration-cache | ||
name: ${{ github.ref }} | ||
generate_release_notes: true |