-
Notifications
You must be signed in to change notification settings - Fork 3
Add github actions for building and releasing hoist-core to maven central #507
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jskupsik
wants to merge
9
commits into
xh:develop
Choose a base branch
from
xh:mavenCentral
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f6cae2e
Initial commit to release/read hoist-core from maven central
jskupsik 8c38c8a
Deployment WIP
jskupsik 9819c40
Added workflow dispatch trigger
jskupsik 49ca4e6
Added workflow dispatch trigger
jskupsik 1dd20d1
Build gradle fix
jskupsik 55836ed
Build gradle fix
jskupsik 45bebdc
claude tests
jskupsik 3cbb06d
fix
jskupsik 6759c2b
typo fix
jskupsik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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,62 @@ | ||
| name: Deploy Release | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| xhReleaseVersion: | ||
| description: 'Release version - set as the xhReleaseVersion' | ||
| required: true | ||
| type: string | ||
|
|
||
| jobs: | ||
| deployRelease: | ||
|
|
||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
|
|
||
| steps: | ||
| - name: Checkout branch ${{ github.ref_name }} | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| ref: ${{ github.ref }} | ||
|
|
||
| - name: Validate tag v${{ inputs.xhReleaseVersion }} does not exist | ||
| run: | | ||
| if git tag --list | grep -q "^v${{ inputs.xhReleaseVersion }}$"; then | ||
| echo "Release tag 'v${{ inputs.xhReleaseVersion }}' already exists. Aborting." | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@v5 | ||
| with: | ||
| java-version: '17' | ||
| distribution: 'zulu' | ||
|
|
||
| - name: Setup Gradle | ||
| uses: gradle/actions/setup-gradle@v5 | ||
|
|
||
| - name: Build and publish release to Sonatype | ||
| env: | ||
| SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | ||
| SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | ||
| SIGNING_KEY_ID: ${{secrets.SIGNING_KEY_ID}} | ||
| SIGNING_PASSWORD: ${{secrets.SIGNING_PASSWORD}} | ||
| SECRING_FILE: ${{ secrets.SECRING_FILE }} | ||
| XH_RELEASE_VERSION: ${{ inputs.xhReleaseVersion }} | ||
| run: | | ||
| echo $SECRING_FILE | base64 -d > secring.gpg | ||
| (set -x; ./gradlew -Psigning.secretKeyRingFile="${GITHUB_WORKSPACE}/secring.gpg" -PxhReleaseVersion="$XH_RELEASE_VERSION" publishToSonatype closeSonatypeStagingRepository --no-daemon) | ||
|
|
||
| - name: Create release tag v${{ inputs.xhReleaseVersion }} | ||
| run: | | ||
| git tag "v${{ inputs.xhReleaseVersion }}" | ||
| git push origin "v${{ inputs.xhReleaseVersion }}" | ||
|
|
||
| - name: Create GitHub Release | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| XH_RELEASE_VERSION: ${{ inputs.xhReleaseVersion }} | ||
| run: gh release create "v$XH_RELEASE_VERSION" --title "v$XH_RELEASE_VERSION" --generate-notes | ||
|
|
||
This file contains hidden or 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,57 @@ | ||
| name: Deploy Snapshot | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| xhReleaseVersionOverride: | ||
| description: '(Optional) Manual override to xhReleaseVersion' | ||
| type: string | ||
| push: | ||
| branches: [ "develop" ] | ||
|
|
||
| jobs: | ||
| deploySnapshot: | ||
|
|
||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
|
|
||
| steps: | ||
| - name: Checkout branch ${{ github.ref_name }} | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| ref: ${{ github.ref }} | ||
| - name: Set up JDK 17 | ||
| uses: actions/setup-java@v5 | ||
| with: | ||
| java-version: '17' | ||
| distribution: 'zulu' | ||
|
|
||
| - name: Setup Gradle | ||
| uses: gradle/actions/setup-gradle@v5 | ||
|
|
||
| - name: Write xhReleaseVersion override to gradle.properties | ||
| if: inputs.xhReleaseVersionOverride != '' | ||
| run: | | ||
| VERSION="${{ inputs.xhReleaseVersionOverride }}" | ||
| if [[ ! "$VERSION" == *-SNAPSHOT ]]; then | ||
| VERSION="$VERSION-SNAPSHOT" | ||
| fi | ||
| sed -i "s/^xhReleaseVersion=.*/xhReleaseVersion=$VERSION/" gradle.properties | ||
| echo "Updated xhReleaseVersion to SNAPSHOT version: $VERSION" | ||
|
|
||
| - name: Validate version | ||
| run: | | ||
| VERSION=$(./gradlew properties -q | grep "^version:" | awk '{print $2}') | ||
| if [[ ! "$VERSION" == *-SNAPSHOT ]]; then | ||
| echo "'$VERSION' is not a SNAPSHOT version. Aborting." | ||
| exit 1 | ||
| fi | ||
| echo "Validated snapshot version: $VERSION" | ||
|
|
||
| - name: Build and publish snapshot to Sonatype | ||
| env: | ||
| SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | ||
| SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | ||
| run: | | ||
| (set -x; ./gradlew publishToSonatype closeSonatypeStagingRepository --no-daemon) |
This file contains hidden or 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 hidden or 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 hidden or 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 @@ | ||
| rootProject.name = 'hoist-core' |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When done demoing - replace
closeSonatypeStagingRepositorywithcloseAndReleaseSonatypeStagingRepositoryto automatically make it go live