Skip to content
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

remove deploy and sign from workflow #417

Merged
merged 1 commit into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/actions/setup-jdk/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,3 @@ runs:
with:
java-version: 17
distribution: adopt
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
35 changes: 7 additions & 28 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,7 @@
name: release

on:
workflow_dispatch:
inputs:
GPG_PRIVATE_KEY:
description: 'The private key to sign the artifacts'
required: true
type: string
OSSRH_USERNAME:
description: 'The username to deploy to Maven Central'
required: true
type: string
OSSRH_TOKEN:
description: 'The token to deploy to Maven Central'
required: true
type: string
workflow_dispatch: { }

jobs:
build_and_deploy:
Expand All @@ -31,18 +18,10 @@ jobs:

- name: Get the version
id: get_version
run: echo ::set-output name=version::$(./mvnw -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)

- name: Import GPG key
run: echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --import
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
run: echo "VERSION=$(./mvnw -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)" >> $GITHUB_ENV

- name: Deploy
run: ./mvnw -P release --batch-mode -DskipTests deploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
run: ./mvnw -P release --batch-mode -DskipTests package

- name: Upload JARs as artifact
uses: actions/upload-artifact@v2
Expand All @@ -58,17 +37,17 @@ jobs:
- uses: ./.github/actions/setup-jdk

- name: Set version
run: ./mvnw versions:set -DnewVersion=${{ steps.get_version.outputs.version }} -DgenerateBackupPoms=false
run: ./mvnw versions:set -DnewVersion=${{ env.VERSION }} -DgenerateBackupPoms=false

- name: Update README.md
run: sed -i "s|<version>.*</version>|<version>${{ steps.get_version.outputs.version }}</version>|g" README.md
run: sed -i "s|<version>.*</version>|<version>${{ env.VERSION }}</version>|g" README.md

- name: Commit release POM and Tag
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -m "Release ${{ steps.get_version.outputs.version }}" -a
git tag ${{ steps.get_version.outputs.version }}
git commit -m "Release ${{ env.VERSION }}" -a
git tag ${{ env.VERSION }}

- name: Set next development version
run: ./mvnw versions:set -DnextSnapshot=true -DgenerateBackupPoms=false
Expand Down
7 changes: 0 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -741,12 +741,5 @@
</plugins>
</reporting>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>

</project>

Loading