Skip to content

Release with GitHub Actions #86

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

Merged
merged 1 commit into from
Jan 18, 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
29 changes: 15 additions & 14 deletions .github/workflows/release-maven-central.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,29 @@ jobs:
with:
fetch-depth: 0

- name: Step 2 - Import GPG key
run: |
echo "${{ secrets.GPG_PUBLIC_KEY }}" | gpg --import
echo "${{ secrets.GPG_SECRET_KEY }}" | gpg --import --no-tty --batch --yes

- name: Step 3 - Set up Maven Central Repository
- name: Step 2 - Set up Maven Central Repository
uses: actions/setup-java@v3
with:
java-version: "8"
distribution: "adopt"
server-id: ossrh
server-username: ${{ secrets.OSSRH_USERNAME }}
server-password: ${{ secrets.OSSRH_TOKEN }}
server-username: MVN_CENTRAL_USERNAME
server-password: MVN_CENTRAL_PASSWORD
gpg-private-key: ${{ secrets.GPG_SECRET_KEY }}
gpg-passphrase: MVN_GPG_PASSPHRASE

- name: Step 4 - Install GitVersion
- name: Step 3 - Install GitVersion
uses: gittools/actions/gitversion/setup@v0
with:
versionSpec: '5.x'
- name: Step 5 - Determine Version

- name: Step 4 - Determine Version
id: gitversion
uses: gittools/actions/gitversion/execute@v0
with:
useConfigFile: true

- name: Step 6 - Create Release
- name: Step 5 - Create Release
id: create_release
uses: actions/create-release@latest
env:
Expand All @@ -54,7 +52,10 @@ jobs:
draft: false
prerelease: false

- name: Step 7 - Publish package
- name: Step 6 - Publish package
run: |
mvn -Dmaven.test.skip=true -P release -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} \
-Drevision=${{ steps.gitversion.outputs.semVer }} deploy
mvn -Dmaven.test.skip=true -P release -Drevision=${{ steps.gitversion.outputs.semVer }} deploy
env:
MVN_CENTRAL_USERNAME: ${{ vars.OSSRH_USERNAME }}
MVN_CENTRAL_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MVN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.github.aquality-automation</groupId>
<artifactId>aquality-selenium-core</artifactId>
<version>3.0.0</version>
<version>${revision}</version>

<packaging>jar</packaging>
<name>Aquality Selenium Core</name>
Expand All @@ -16,6 +16,7 @@
<properties>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<revision>3.0.0-SNAPSHOT</revision>
</properties>

<distributionManagement>
Expand Down