Resolves #12 - was monitor branch sfloess_issue-10 for build changes #69
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
# This workflow will build a Java project with Maven | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven | |
# if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.event.pusher.email != 'version-bump@solenopsis.org' | |
name: CD-CI for RPM | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
build: | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.event.pusher.email != 'version-bump@flossware.org' | |
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/maven-settings-action@v3.0.0 | |
with: | |
githubServer: false | |
servers: | | |
[ | |
{ | |
"id": "packagecloud-flossware", | |
"configuration": { | |
"httpHeaders": { | |
"property": { | |
"name": "Authorization", | |
"value": "${{ secrets.PCT }}" | |
} | |
} | |
} | |
} | |
] | |
- name: Setup .gitconfig for version bumps | |
uses: oleksiyrudenko/gha-git-credentials@latest | |
with: | |
global: true | |
name: 'Version Bump' | |
email: 'version-bump@flossware.org' | |
actor: 'VersionBump' | |
token: '${{ secrets.GITHUB_TOKEN }}' | |
- name: Preparing settings.xml | |
uses: s4u/maven-settings-action@v3.0.0 | |
with: | |
githubServer: false | |
servers: | | |
[ | |
{ | |
"id": "packagecloud-flossware", | |
"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: 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" |