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

Updated release acton (as part of #2880) #2885 #2886

Merged
merged 1 commit into from
Jun 7, 2024
Merged
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
20 changes: 11 additions & 9 deletions .github/workflows/version-and-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,25 @@ name: Release

on:
release:
types: [published]
types: [published] # once a release is published in the GitHub UI
workflow_dispatch: # or manually, by clicking the button

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: 1. Checkout sources
uses: actions/checkout@v4

- name: get version from tag
- name: 2. Extract version from tag
id: get_version
run: |
realversion="${GITHUB_REF/refs\/tags\//}"
realversion="${realversion//v/}"
echo "VERSION=$realversion" >> $GITHUB_OUTPUT

- name: Set up publishing to maven central
- name: 3. Set up Java with Maven cache
uses: actions/setup-java@v4
with:
java-version: '8'
Expand All @@ -28,20 +30,20 @@ jobs:
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD

- name: mvn versions
- name: 4. Update version in Maven configuration
run: mvn versions:set -DnewVersion=${{ steps.get_version.outputs.VERSION }}

- name: Install gpg key
- name: 5. Install GPG key
run: |
cat <(echo -e "${{ secrets.OSSH_GPG_SECRET_KEY }}") | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG

- name: Publish
- name: 6. Publish to Maven
run: |
mvn --no-transfer-progress \
--batch-mode \
-Dgpg.passphrase='${{ secrets.OSSH_GPG_SECRET_KEY_PASSWORD }}' \
deploy -P release
release:perform
env:
MAVEN_USERNAME: ${{secrets.OSSH_USERNAME}}
MAVEN_PASSWORD: ${{secrets.OSSH_TOKEN}}
MAVEN_PASSWORD: ${{secrets.OSSH_TOKEN}}
Loading