Add release workflow #25
Workflow file for this run
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
name: 'Test PR' | |
on: pull_request | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
version-bump: | |
name: 'Version Bump' | |
runs-on: ubuntu-latest | |
steps: | |
- name: 'Check out code' | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.JENKINS_GITHUB_PAT }} | |
# fetch-depth 0 means deep clone the repo | |
fetch-depth: 0 | |
- name: 'Update version' | |
run: | | |
set -x | |
git config user.name devops | |
git config user.email [email protected] | |
./package/version.sh bump $(git show origin/${GITHUB_BASE_REF}:package/version) | |
./package/version.sh sub | |
if git add --update && git commit --message "Set Version: $(cat package/version)"; then | |
git push origin HEAD:${GITHUB_HEAD_REF} | |
fi | |
tests: | |
needs: version-bump | |
name: 'Run tests' | |
runs-on: ubuntu-latest | |
steps: | |
- name: 'Check out code' | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: 'Set up Java 17' | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- name: 'Install Maven' | |
run: sudo apt-get update && sudo apt-get install --yes maven | |
- name: 'Check code is formatted correctly' | |
run: mvn spotless:check --batch-mode -U | |
- name: 'Run tests' | |
run: mvn verify --batch-mode -U |