-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated build, post_build & release (#31)
Co-authored-by: OmOmofonmwan <[email protected]>
- Loading branch information
1 parent
cf708a3
commit d3fd31d
Showing
4 changed files
with
84 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,33 +2,36 @@ name: Build Workflow | |
|
||
run-name: 'Build Workflow -- ${{ github.head_ref || github.ref_name }}' | ||
|
||
# Pipeline/Workflow Triggers | ||
on: | ||
push: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
env: | ||
BRANCH_NAME: ${{github.ref_name}} | ||
|
||
jobs: | ||
pr-verification: | ||
name: Pull Request Validation | ||
runs-on: ubuntu-24.04 | ||
if: github.event_name == 'pull_request' | ||
steps: | ||
- name: Pull Request Version Validation | ||
uses: ikmdev/[email protected] | ||
|
||
build-job: | ||
name: Build Job | ||
runs-on: ubuntu-24.04 | ||
if: github.repository_owner == 'ikmdev' | ||
steps: | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-java@v4 | ||
with: | ||
java-version: '21' | ||
distribution: 'zulu' | ||
|
||
- name: Build IKMDEV Code | ||
uses: ikmdev/maven-clean-install-build-action@v1.1.0 | ||
uses: ikmdev/maven-clean-install-build-action@v2.0.0 | ||
with: | ||
branch_name: ${{env.BRANCH_NAME}} | ||
sonarcloud_token: ${{ secrets.SONAR_TOKEN }} | ||
sonarcloud_host_url: ${{ 'https://sonarcloud.io/' }} | ||
sonarcloud_organization: ${{ github.repository_owner }} | ||
sonarcloud_sources: ${{ 'src/main/java' }} | ||
sonarcloud_projectKey: ${{ github.repository_owner }}_${{ github.event.repository.name }} | ||
sonarcloud_coverage_jacoco_xmlReportPaths: ${{ 'target/site/jacoco/jacoco.xml' }} | ||
sonarcloud_java_binaries: ${{ 'target/classes' }} | ||
sonarcloud_tests: ${{ '' }} | ||
branch_name: ${{github.ref_name}} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Post Build Action | ||
|
||
run-name: 'Post Build Action -- ${{github.event.workflow_run.head_branch}}' | ||
|
||
on: | ||
workflow_run: | ||
workflows: | ||
- Build Workflow | ||
types: | ||
- completed | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
post-build: | ||
name: Post Build Actions | ||
runs-on: ubuntu-24.04 | ||
if: github.event.workflow_run.conclusion == 'success' && github.repository_owner == 'ikmdev' | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: ${{github.event.workflow_run.head_repository.full_name}} | ||
ref: ${{github.event.workflow_run.head_branch}} | ||
fetch-depth: 0 | ||
|
||
- name: IKMDEV Post Build Action | ||
id: ikmdev_post_build | ||
uses: ikmdev/[email protected] | ||
with: | ||
nexus_repo_password: ${{secrets.EC2_NEXUS_PASSWORD}} | ||
branch_name: ${{github.event.workflow_run.head_branch}} | ||
github_token: ${{secrets.GITHUB_TOKEN}} | ||
ossrh_username: ${{secrets.OSSRH_TOKEN_USER}} | ||
ossrh_token: ${{secrets.OSSRH_TOKEN_PASS}} | ||
gpg_key: ${{secrets.GPG_KEY}} | ||
gpg_passphrase: ${{secrets.GPG_PASSPHRASE}} | ||
sonarcloud_token: ${{ secrets.SONAR_TOKEN }} | ||
sonarcloud_tests: ${{ '' }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,28 @@ | ||
name: Release Workflow | ||
name: SemVer Release Workflow | ||
|
||
run-name: "Releasing ${{ github.event.repository.name }} #${{github.run_number}}" | ||
|
||
# Trigger workflow manually | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
release_version: | ||
type: string | ||
description: "(Optional) Custom Release Version" | ||
required: false | ||
version_type: | ||
description: 'Development version type to increment' | ||
required: true | ||
default: 'minor' | ||
type: choice | ||
options: | ||
- major | ||
- minor | ||
- patch | ||
|
||
env: | ||
BRANCH_NAME: ${{github.ref_name}} | ||
TRUNK_BRANCH_NAME: 'main' | ||
BRANCH_NAME: ${{ github.ref_name }} | ||
TRUNK_BRANCH_NAME: ${{ github.event.repository.default_branch }} | ||
|
||
jobs: | ||
release: | ||
|
@@ -19,15 +33,17 @@ jobs: | |
- name: Verify Branch | ||
if: env.BRANCH_NAME != env.TRUNK_BRANCH_NAME | ||
run: | | ||
echo "ERROR: Attempting to release from branch ${{env.BRANCH_NAME}}. Release from ${{env.TRUNK_BRANCH_NAME}} branch only" | ||
echo "ERROR: Attempting to release from branch ${{ env.BRANCH_NAME }}. Release from ${{ env.TRUNK_BRANCH_NAME }} branch only." | ||
exit 1 | ||
- name: Release IKMDEV Code | ||
uses: ikmdev/[email protected] | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
with: | ||
ikmdevops_pat: ${{secrets.IKMDEVOPS_PAT_TOKEN}} | ||
token: ${{secrets.IKMDEVOPS_PAT_TOKEN}} | ||
|
||
- name: Shared Release Action | ||
uses: ikmdev/[email protected] | ||
with: | ||
version_type: ${{ github.event.inputs.version_type }} | ||
github_token: ${{secrets.GITHUB_TOKEN}} | ||
ossrh_username: ${{secrets.OSSRH_TOKEN_USER}} | ||
ossrh_token: ${{secrets.OSSRH_TOKEN_PASS}} | ||
gpg_key: ${{secrets.GPG_KEY}} | ||
gpg_passphrase: ${{secrets.GPG_PASSPHRASE}} | ||
release_version: ${{ github.event.inputs.release_version }} |