Skip to content

Commit

Permalink
chore(release): create GH release
Browse files Browse the repository at this point in the history
[no-jira]
  • Loading branch information
chris-asl committed Sep 13, 2023
1 parent 01f56d0 commit 610ce16
Showing 1 changed file with 36 additions and 28 deletions.
64 changes: 36 additions & 28 deletions .github/workflows/release.yml
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
Expand All @@ -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

0 comments on commit 610ce16

Please sign in to comment.