Skip to content

Commit

Permalink
Merge pull request #21 from Netcracker/feature/workflows-2
Browse files Browse the repository at this point in the history
chore: Remove outdated GitHub Actions workflows and release drafter c…
  • Loading branch information
borislavr authored Jan 27, 2025
2 parents 6e99232 + b656ae9 commit 062f062
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 103 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ version-resolver:
patch:
labels:
- patch
default: patch
default: patch
45 changes: 0 additions & 45 deletions .github/workflows/github-release.yaml

This file was deleted.

91 changes: 91 additions & 0 deletions .github/workflows/maven-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
---

# This GitHub Actions workflow is designed to be triggered when a release is marked as a full release.
# The workflow performs the following tasks:
# - Extract Release Version: Extracts the tag name and removes the leading 'v' character to get the release version.
# - Update pom.xml: Updates the version in the pom.xml file using the extracted release version.
# - Publish to Maven: Publishes the artifact to the Maven repository using the updated pom.xml.

name: Release And Upload to Maven Central

on:
workflow_dispatch:
inputs:
version:
required: true
default: '2025.1-1.0.0'
type: string
description: 'Release version (e.g., 2025.1-1.0.0)'
java_version:
required: false
type: string
default: "21"
description: 'Java version (e.g., 21)'

jobs:
check-tag:
runs-on: ubuntu-latest
steps:
- name: Input parameters
run: |
echo "Version: ${{ github.event.inputs.version }}" >> $GITHUB_STEP_SUMMARY
echo "Java version: ${{ github.event.inputs.java_version }}" >> $GITHUB_STEP_SUMMARY
- name: Checkout code
uses: actions/checkout@v4

- name: Check if tag exists
id: check_tag
uses: netcracker/qubership-workflow-hub/actions/tag-checker@main
with:
tag: 'v${{ github.event.inputs.version }}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Output result
run: |
echo "Tag exists: ${{ steps.check_tag.outputs.exists }}"
echo "Tag name: v${{ github.event.inputs.version }}"
- name: Fail if tag exists
if: steps.check_tag.outputs.exists == 'true'
run: |
echo "Tag already exists: v${{ github.event.inputs.version }}" >> $GITHUB_STEP_SUMMARY
echo "Tag already exists: v${{ github.event.inputs.version }}"
exit 1
update-pom-version:
needs: [check-tag]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Update pom.xml
uses: Netcracker/qubership-workflow-hub/actions/pom-updater@main
with:
new_value: ${{ github.event.inputs.version }}
- name: Commit Changes
uses: Netcracker/qubership-workflow-hub/actions/commit-and-push@main
with:
commit_message: "Update pom.xml version to ${{ github.event.inputs.version }}"

upload_to_maven_central:
needs: [update-pom-version]
uses: Netcracker/qubership-workflow-hub/.github/workflows/maven-publish.yml@main
with:
maven_command: "--batch-mode deploy"
java_version: ${{ github.event.inputs.java_version }}
version: ${{ github.event.inputs.version }}
secrets:
maven_username: ${{ secrets.MAVEN_USER }}
maven_password: ${{ secrets.MAVEN_PASSWORD }}
maven_gpg_passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
maven_gpg_private_key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}

github-release:
needs: [publish]
uses: Netcracker/qubership-workflow-hub/.github/workflows/release-drafter.yml@main
with:
version: ${{ github.event.inputs.version }}
publish: false
57 changes: 0 additions & 57 deletions .github/workflows/upload-to-maven-central.yaml

This file was deleted.

0 comments on commit 062f062

Please sign in to comment.