-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
274 additions
and
197 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
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Dependabot | ||
|
||
on: [ pull_request_target ] | ||
|
||
jobs: | ||
dependabot: | ||
runs-on: ubuntu-latest | ||
if: github.event.pull_request.user.login == 'dependabot[bot]' | ||
permissions: | ||
pull-requests: write | ||
contents: write | ||
steps: | ||
- name: Dependabot metadata | ||
id: dependabot-metadata | ||
uses: dependabot/[email protected] | ||
|
||
- name: Enable auto-merge for dependabot PRs | ||
run: gh pr merge --auto --rebase "$PR_URL" | ||
env: | ||
PR_URL: ${{ github.event.pull_request.html_url }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Approve patch and minor updates | ||
if: steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' || steps.dependabot-metadata.outputs.package-ecosystem == 'github-actions' | ||
run: gh pr review $PR_URL --approve -b "Pull request **approved** because **it includes a patch or minor update**" | ||
env: | ||
PR_URL: ${{ github.event.pull_request.html_url }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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 |
---|---|---|
|
@@ -19,26 +19,11 @@ on: | |
- SNAPSHOT | ||
required: true | ||
default: AUTO | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Validate build succeeded | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
declare -r BUILD_SUCCESS="$(gh api \ | ||
-H "Accept: application/vnd.github+json" \ | ||
/repos/${{ github.repository }}/actions/runs?status=success\&head_sha=${{ github.sha }} \ | ||
| jq 'limit(1; .workflow_runs[] | select(.name == "Build" and .conclusion == "success"))')" | ||
if [ -z "$BUILD_SUCCESS" ]; then | ||
echo "Commit did not pass Build!" | ||
exit 1 | ||
fi | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
|
@@ -81,93 +66,9 @@ jobs: | |
git_committer_name: Coditory Bot | ||
git_committer_email: [email protected] | ||
|
||
- name: Update version in README (main only) | ||
- name: Create Release Tag | ||
if: steps.gpg.conclusion == 'success' | ||
env: | ||
PREV_VERSION: ${{ steps.versions.outputs.version }} | ||
NEXT_VERSION: ${{ steps.versions.outputs.next_version }} | ||
run: | | ||
declare -r ESC_PREV_VERSION="${PREV_VERSION//./\\.}" | ||
echo "Changing: $PREV_VERSION -> $NEXT_VERSION" | ||
sed -i "s|${ESC_PREV_VERSION}|${NEXT_VERSION}|" README.md | ||
sed -i "s|${ESC_PREV_VERSION}|${NEXT_VERSION}|" mkdocs.yml | ||
if [ -n "$(git status --porcelain)" ]; then | ||
git add -A | ||
git commit -a -m "Update version in docs $PREV_VERSION -> $NEXT_VERSION" -m "[ci skip]" | ||
git push origin main | ||
else | ||
echo "Nothing changed. Skipping commit." | ||
fi | ||
- name: Setup JDK | ||
if: inputs.publish != 'SKIP' | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: 21 | ||
cache: gradle | ||
distribution: temurin | ||
|
||
- name: Publish release | ||
if: | | ||
github.event_name == 'release' | ||
|| inputs.publish == 'RELEASE' | ||
|| (inputs.publish == 'AUTO' && github.ref == 'refs/heads/main') | ||
env: | ||
NEXT_VERSION: ${{ steps.versions.outputs.next_version }} | ||
SIGNING_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | ||
SIGNING_PASSWORD: ${{ secrets.GPG_PASSPHRASE }} | ||
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} | ||
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | ||
run: | | ||
./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository -Pversion=$NEXT_VERSION -Ppublish --info | ||
echo "Published release: $NEXT_VERSION" | ||
- name: Generate release notes | ||
id: notes | ||
if: | | ||
github.event_name != 'release' | ||
&& github.ref == 'refs/heads/main' | ||
&& inputs.publish != 'SNAPSHOT' | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
PREV_VERSION: ${{ steps.versions.outputs.version }} | ||
NEXT_VERSION: ${{ steps.versions.outputs.next_version }} | ||
run: | | ||
declare -r NOTES="$(gh api \ | ||
--method POST \ | ||
-H "Accept: application/vnd.github+json" \ | ||
/repos/${{ github.repository }}/releases/generate-notes \ | ||
-f tag_name="v$NEXT_VERSION" \ | ||
-f target_commitish='main' \ | ||
-f previous_tag_name="v$PREV_VERSION" \ | ||
| jq -r '.body')" | ||
declare -r ESCAPED="${NOTES//$'\n'/'%0A'}" | ||
echo "notes=$ESCAPED" >> $GITHUB_OUTPUT | ||
- name: Create github release (main only) | ||
if: steps.notes.conclusion == 'success' | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
allowUpdates: true | ||
body: ${{ steps.notes.outputs.notes }} | ||
draft: ${{ inputs.publish == 'SKIP' }} | ||
tag: v${{ steps.versions.outputs.next_version }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Publish snapshot | ||
if: | | ||
github.event_name == 'workflow_dispatch' | ||
&& ( | ||
inputs.publish == 'SNAPSHOT' | ||
|| inputs.publish == 'AUTO' && github.ref != 'refs/heads/main' | ||
) | ||
env: | ||
NEXT_VERSION: ${{ steps.versions.outputs.next_version }} | ||
SIGNING_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | ||
SIGNING_PASSWORD: ${{ secrets.GPG_PASSPHRASE }} | ||
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} | ||
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | ||
run: | | ||
declare -r MIDDLE="$([ "$GITHUB_REF" == "refs/heads/main" ] && echo "" || echo "-${GITHUB_REF#refs/heads/}")" | ||
./gradlew publishToSonatype -Pversion="${NEXT_VERSION}${MIDDLE}-SNAPSHOT" -Ppublish | ||
echo "Published snapshot: ${NEXT_VERSION}${MIDDLE}-SNAPSHOT" | ||
git push origin master "v$NEXT_VERSION" |
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
This file was deleted.
Oops, something went wrong.
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
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
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
Oops, something went wrong.