Skip to content

Commit 5d297d8

Browse files
authored
Add workflow triggers (#51)
1 parent 63d1158 commit 5d297d8

File tree

3 files changed

+30
-7
lines changed

3 files changed

+30
-7
lines changed

.github/workflows/build-package.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
name: Build Maven Package
22

3-
on: [push]
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
pull_request:
8+
# The branches below must be a subset of the branches above
9+
branches: [ main, master ]
410

511
jobs:
612
package:
@@ -13,5 +19,13 @@ jobs:
1319
with:
1420
java-version: 1.8
1521

22+
- name: Load local Maven repository cache
23+
uses: actions/cache@v2
24+
with:
25+
path: ~/.m2/repository
26+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
27+
restore-keys: |
28+
${{ runner.os }}-maven-
29+
1630
- name: Run mvn package
1731
run: mvn -B package --file pom.xml

.github/workflows/create-release.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
|| contains(github.event.inputs.versionTag, 'rc')) }}
4545
uses: actions/github-script@v4.0.2
4646
with:
47-
github-token: ${{secrets.GITHUB_TOKEN}}
47+
github-token: ${{secrets.JOHNNY_Q5_REPORTS_TOKEN}}
4848
script: |
4949
await github.request(`POST /repos/${{ github.repository }}/releases`, {
5050
tag_name: "${{ github.event.inputs.versionTag }}",
@@ -58,7 +58,7 @@ jobs:
5858
|| contains(github.event.inputs.versionTag, 'rc')) }}
5959
uses: actions/github-script@v4.0.2
6060
with:
61-
github-token: ${{secrets.GITHUB_TOKEN}}
61+
github-token: ${{secrets.JOHNNY_Q5_REPORTS_TOKEN}}
6262
script: |
6363
await github.request(`POST /repos/${{ github.repository }}/releases`, {
6464
tag_name: "${{ github.event.inputs.versionTag }}",
@@ -75,16 +75,19 @@ jobs:
7575
- name: Switch to new branch
7676
run: git checkout -b release/set-version-to-${{ github.event.inputs.versionTag }}
7777

78+
- name: Set remote branch
79+
run: git push --set-upstream origin release/set-version-to-${{ github.event.inputs.versionTag }}
80+
7881
- name: Checkin commit
7982
run: git commit . -m 'Set version to ${{ github.event.inputs.versionTag }}'
8083

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

8487
- name: Open PR with version bump
8588
uses: actions/github-script@v4.0.2
8689
with:
87-
github-token: ${{secrets.GITHUB_TOKEN}}
90+
github-token: ${{secrets.JOHNNY_Q5_REPORTS_TOKEN}}
8891
script: |
8992
await github.request(`POST /repos/${{ github.repository }}/pulls`, {
9093
title: 'Update version to ${{ github.event.inputs.versionTag }}',

.github/workflows/run-tests.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
name: Run Maven Tests
22

3-
on: [push]
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
pull_request:
8+
# The branches below must be a subset of the branches above
9+
branches: [ main, master ]
410

511
jobs:
612
test:

0 commit comments

Comments
 (0)