-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolves #10 - use github action to automatically bump version, use l…
…atest dependencies, push to packagecloud.io and push out changes
- Loading branch information
Showing
1 changed file
with
85 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,85 @@ | ||
name: CD-CI | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build: | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.event.pusher.email != '[email protected]' | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Updating runner | ||
run: sudo apt-get update | ||
|
||
- name: Setup JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Preparing settings.xml | ||
uses: s4u/[email protected] | ||
with: | ||
githubServer: false | ||
servers: | | ||
[ | ||
{ | ||
"id": "packagecloud-solenopsis", | ||
"configuration": { | ||
"httpHeaders": { | ||
"property": { | ||
"name": "Authorization", | ||
"value": "Bearer ${{ secrets.PACKAGECLOUD_TOKEN }}" | ||
} | ||
} | ||
} | ||
} | ||
] | ||
- name: Setup .gitconfig for version bumps | ||
uses: oleksiyrudenko/gha-git-credentials@latest | ||
with: | ||
global: true | ||
name: 'Version Bump' | ||
email: '[email protected]' | ||
actor: 'VersionBump' | ||
token: '${{ secrets.GITHUB_TOKEN }}' | ||
|
||
- name: Preparing settings.xml | ||
uses: s4u/[email protected] | ||
with: | ||
githubServer: false | ||
servers: | | ||
[ | ||
{ | ||
"id": "packagecloud-solenopsis", | ||
"configuration": { | ||
"httpHeaders": { | ||
"property": { | ||
"name": "Authorization", | ||
"value": "Bearer ${{ secrets.PACKAGECLOUD_TOKEN }}" | ||
} | ||
} | ||
} | ||
} | ||
] | ||
- name: Incrementing pom.xml version | ||
run: "mvn -U build-helper:parse-version versions:set -DnewVersion=\\${parsedVersion.majorVersion}.\\${parsedVersion.nextMinorVersion} versions:commit" | ||
|
||
- name: Ensure latests depenendencies in pom.xml | ||
run: "mvn -Dincludes='org.apache.commons:*, org.apache.cxf:*, org.flossware:*, org.junit.jupiter:*' -DgenerateBackupPoms=false versions:update-properties" | ||
|
||
- name: Building | ||
run: "mvn -U clean install" | ||
|
||
- name: Deploy to packagecloud.io | ||
run: "mvn -DskipTests deploy" | ||
|
||
- name: Checkin and tag to github | ||
run: "mvn scm:checkin scm:tag" |