-
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.
Merge pull request #27 from castor-software/issue_26
Deploy to Maven Central v0.0.1
- Loading branch information
Showing
3 changed files
with
157 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Deploy | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
versionName: | ||
description: 'Version Name' | ||
required: true | ||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out Git repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Java and Maven | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'adopt-hotspot' | ||
java-version: 17 | ||
server-id: ossrh | ||
server-username: OSSRH_USERNAME # env variable for username in deploy | ||
server-password: OSSRH_TOKEN # env variable for token in deploy | ||
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # Value of the GPG private key to import | ||
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase | ||
|
||
- name: Release Maven package | ||
run: mvn deploy -P deploy -Djacoco.skip=true | ||
env: | ||
OSSRH_USERNAME: ${{ secrets.NEXUS_USERNAME }} | ||
OSSRH_TOKEN: ${{ secrets.NEXUS_PASSWORD }} | ||
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
|
||
- name: Create and push tag | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "$GITHUB_ACTOR" | ||
git tag -a $TAG -m "Release v$TAG" | ||
git push origin $TAG | ||
env: | ||
TAG: ${{ github.event.inputs.versionName }} | ||
|
||
- name: Create Release on GitHub | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.event.inputs.versionName }} | ||
release_name: MyLib ${{ github.event.inputs.versionName }} | ||
draft: true | ||
prerelease: false |
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