Skip to content

Commit

Permalink
Add workflow triggers (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
sven1103 authored Feb 28, 2022
1 parent 63d1158 commit 5d297d8
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 7 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/build-package.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: Build Maven Package

on: [push]
on:
push:
branches:
- '*'
pull_request:
# The branches below must be a subset of the branches above
branches: [ main, master ]

jobs:
package:
Expand All @@ -13,5 +19,13 @@ jobs:
with:
java-version: 1.8

- name: Load local Maven repository cache
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Run mvn package
run: mvn -B package --file pom.xml
13 changes: 8 additions & 5 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
|| contains(github.event.inputs.versionTag, 'rc')) }}
uses: actions/[email protected]
with:
github-token: ${{secrets.GITHUB_TOKEN}}
github-token: ${{secrets.JOHNNY_Q5_REPORTS_TOKEN}}
script: |
await github.request(`POST /repos/${{ github.repository }}/releases`, {
tag_name: "${{ github.event.inputs.versionTag }}",
Expand All @@ -58,7 +58,7 @@ jobs:
|| contains(github.event.inputs.versionTag, 'rc')) }}
uses: actions/[email protected]
with:
github-token: ${{secrets.GITHUB_TOKEN}}
github-token: ${{secrets.JOHNNY_Q5_REPORTS_TOKEN}}
script: |
await github.request(`POST /repos/${{ github.repository }}/releases`, {
tag_name: "${{ github.event.inputs.versionTag }}",
Expand All @@ -75,16 +75,19 @@ jobs:
- name: Switch to new branch
run: git checkout -b release/set-version-to-${{ github.event.inputs.versionTag }}

- name: Set remote branch
run: git push --set-upstream origin release/set-version-to-${{ github.event.inputs.versionTag }}

- name: Checkin commit
run: git commit . -m 'Set version to ${{ github.event.inputs.versionTag }}'

- name: Set remote branch
run: git push --set-upstream origin release/set-version-to-${{ github.event.inputs.versionTag }}
- name: Push to Github
run: git push

- name: Open PR with version bump
uses: actions/[email protected]
with:
github-token: ${{secrets.GITHUB_TOKEN}}
github-token: ${{secrets.JOHNNY_Q5_REPORTS_TOKEN}}
script: |
await github.request(`POST /repos/${{ github.repository }}/pulls`, {
title: 'Update version to ${{ github.event.inputs.versionTag }}',
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: Run Maven Tests

on: [push]
on:
push:
branches:
- '*'
pull_request:
# The branches below must be a subset of the branches above
branches: [ main, master ]

jobs:
test:
Expand Down

0 comments on commit 5d297d8

Please sign in to comment.