Skip to content

Commit eaa4fea

Browse files
authored
Update GitHub Actions (#124)
Updates all actions to the latest version using node.js 16. The label action was replaced by a maintained action.
1 parent 7292a19 commit eaa4fea

11 files changed

+130
-105
lines changed

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "github-actions" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "weekly"

.github/labeler.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
feature:
2+
- any:
3+
- head-branch: [ '^feature' ]
4+
fix:
5+
- any:
6+
- head-branch: [ '^fix', '^hotfix' ]
7+
chore:
8+
- any:
9+
- head-branch: [ '^chore', '^documentation', '^docs', '^ci', '^refactor' ]
10+
release:
11+
- all:
12+
- base-branch: [ 'main', 'master' ]
13+
- head-branch: [ 'development', 'dev' ]

.github/pr-labels.yml

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/workflows/build_package.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@v2
17-
- name: Set up JDK 1.8
18-
uses: actions/setup-java@v1
16+
- name: Checkout repository
17+
uses: actions/checkout@v3
18+
- name: Set up JDK 8
19+
uses: actions/setup-java@v3
1920
with:
20-
java-version: 1.8
21+
distribution: 'zulu'
22+
java-version: '8'
2123
- name: Load local Maven repository cache
22-
uses: actions/cache@v2
24+
uses: actions/cache@v3
2325
with:
2426
path: ~/.m2/repository
2527
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}

.github/workflows/codeql-analysis.yml

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,15 @@ name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: [ master, development, patch/*, release/*, hotfix/* ]
16+
branches: [ main, master, development, release/*, hotfix/* ]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
19-
branches: [ master ]
19+
branches: [ main, master ]
2020
schedule:
2121
- cron: '21 1 * * 4'
2222

2323
jobs:
2424
analyze:
25-
name: analyze
2625
runs-on: ubuntu-latest
2726
permissions:
2827
actions: read
@@ -37,47 +36,48 @@ jobs:
3736
# Learn more about CodeQL language support at https://git.io/codeql-language-support
3837

3938
steps:
40-
- name: Checkout repository
41-
uses: actions/checkout@v2
42-
- name: Set up JDK 1.8
43-
uses: actions/setup-java@v1
44-
with:
45-
java-version: 1.8
46-
settings-path: ${{ github.workspace }}
39+
- name: Checkout repository
40+
uses: actions/checkout@v3
41+
- name: Set up JDK 8
42+
uses: actions/setup-java@v3
43+
with:
44+
distribution: 'zulu'
45+
java-version: '8'
46+
settings-path: ${{ github.workspace }}
4747

48-
- name: Load local Maven repository cache
49-
uses: actions/cache@v2
50-
with:
51-
path: ~/.m2/repository
52-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
53-
restore-keys: |
54-
${{ runner.os }}-maven-
48+
- name: Load local Maven repository cache
49+
uses: actions/cache@v3
50+
with:
51+
path: ~/.m2/repository
52+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
53+
restore-keys: |
54+
${{ runner.os }}-maven-
5555
56-
# Initializes the CodeQL tools for scanning.
57-
- name: Initialize CodeQL
58-
uses: github/codeql-action/init@v1
59-
with:
60-
languages: ${{ matrix.language }}
61-
# If you wish to specify custom queries, you can do so here or in a config file.
62-
# By default, queries listed here will override any specified in a config file.
63-
# Prefix the list here with "+" to use these queries and those in the config file.
64-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
56+
# Initializes the CodeQL tools for scanning.
57+
- name: Initialize CodeQL
58+
uses: github/codeql-action/init@v2
59+
with:
60+
languages: ${{ matrix.language }}
61+
# If you wish to specify custom queries, you can do so here or in a config file.
62+
# By default, queries listed here will override any specified in a config file.
63+
# Prefix the list here with "+" to use these queries and those in the config file.
64+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
6565

66-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
67-
# If this step fails, then you should remove it and run the build manually (see below)
68-
- name: Autobuild
69-
uses: github/codeql-action/autobuild@v1
66+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
67+
# If this step fails, then you should remove it and run the build manually (see below)
68+
- name: Autobuild
69+
uses: github/codeql-action/autobuild@v2
7070

71-
# ℹ️ Command-line programs to run using the OS shell.
72-
# 📚 https://git.io/JvXDl
71+
# ℹ️ Command-line programs to run using the OS shell.
72+
# 📚 https://git.io/JvXDl
7373

74-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
75-
# and modify them (or add more) to build your code if your project
76-
# uses a compiled language
74+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
75+
# and modify them (or add more) to build your code if your project
76+
# uses a compiled language
7777

78-
#- run: |
79-
# make bootstrap
80-
# make release
78+
#- run: |
79+
# make bootstrap
80+
# make release
8181

82-
- name: Perform CodeQL Analysis
83-
uses: github/codeql-action/analyze@v1
82+
- name: Perform CodeQL Analysis
83+
uses: github/codeql-action/analyze@v2

.github/workflows/create-release.yml

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,28 @@ jobs:
1111
release:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v2
15-
- name: Set up JDK 1.8
16-
uses: actions/setup-java@v1
14+
- name: Checkout repository
15+
uses: actions/checkout@v3
16+
- name: Set up JDK 8
17+
uses: actions/setup-java@v3
1718
with:
18-
java-version: 1.8
19+
distribution: 'zulu'
20+
java-version: '8'
1921
settings-path: ${{ github.workspace }}
2022

2123
- name: Load local Maven repository cache
22-
uses: actions/cache@v2
24+
uses: actions/cache@v3
2325
with:
2426
path: ~/.m2/repository
2527
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
2628
restore-keys: |
2729
${{ runner.os }}-maven-
30+
2831
- name: Set up git
2932
run: |
3033
git config --global user.email "[email protected]"
3134
git config --global user.name "JohnnyQ5"
35+
3236
- name: Set version in Maven project
3337
run: mvn versions:set -DnewVersion=${{ github.event.inputs.versionTag }}
3438

@@ -40,20 +44,21 @@ jobs:
4044
&& !( contains(github.event.inputs.versionTag, 'alpha')
4145
|| contains(github.event.inputs.versionTag, 'beta')
4246
|| contains(github.event.inputs.versionTag, 'rc')) }}
43-
uses: actions/github-script@v4.0.2
47+
uses: actions/github-script@v6
4448
with:
4549
github-token: ${{secrets.JOHNNY_Q5_REPORTS_TOKEN}}
4650
script: |
4751
await github.request(`POST /repos/${{ github.repository }}/releases`, {
4852
tag_name: "${{ github.event.inputs.versionTag }}",
4953
generate_release_notes: true
5054
});
55+
5156
- name: Create Pre-Release Notes
5257
if: ${{ !startsWith(github.ref, 'refs/tags/')
5358
&& ( contains(github.event.inputs.versionTag, 'alpha')
5459
|| contains(github.event.inputs.versionTag, 'beta')
5560
|| contains(github.event.inputs.versionTag, 'rc')) }}
56-
uses: actions/github-script@v4.0.2
61+
uses: actions/github-script@v6
5762
with:
5863
github-token: ${{secrets.JOHNNY_Q5_REPORTS_TOKEN}}
5964
script: |
@@ -62,6 +67,7 @@ jobs:
6267
generate_release_notes: true,
6368
prerelease: true
6469
});
70+
6571
- name: Publish artefact to QBiC Nexus Repository
6672
run: mvn --quiet --settings $GITHUB_WORKSPACE/.github.settings.xml deploy
6773
env:
@@ -81,23 +87,12 @@ jobs:
8187
run: git push
8288

8389
- name: Open PR with version bump
84-
uses: actions/github-script@v4.0.2
90+
uses: actions/github-script@v6
8591
with:
8692
github-token: ${{secrets.JOHNNY_Q5_REPORTS_TOKEN}}
8793
script: |
8894
await github.request(`POST /repos/${{ github.repository }}/pulls`, {
8995
title: 'Update version to ${{ github.event.inputs.versionTag }}',
9096
head: 'release/set-version-to-${{ github.event.inputs.versionTag }}',
91-
base: 'master'
92-
});
93-
94-
- name: Open PR to development
95-
uses: actions/[email protected]
96-
with:
97-
github-token: ${{secrets.JOHNNY_Q5_REPORTS_TOKEN}}
98-
script: |
99-
await github.request(`POST /repos/${{ github.repository }}/pulls`, {
100-
title: 'Merge release ${{ github.event.inputs.versionTag }} into development',
101-
head: 'master',
102-
base: 'development'
97+
base: 'main'
10398
});

.github/workflows/java_checkstyle.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ jobs:
77
runs-on: ubuntu-latest
88

99
steps:
10-
- uses: actions/checkout@v2
11-
- name: Set up JDK 1.8
12-
uses: actions/setup-java@v1
10+
- name: Checkout repository
11+
uses: actions/checkout@v3
12+
- name: Set up JDK 8
13+
uses: actions/setup-java@v3
1314
with:
14-
java-version: 1.8
15+
distribution: 'zulu'
16+
java-version: '8'
1517

1618
- name: Download Checkstyle
1719
run: wget https://github.com/checkstyle/checkstyle/releases/download/checkstyle-8.31/checkstyle-8.31-all.jar

.github/workflows/label-pull-request.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Label Pull Requests
2+
3+
permissions:
4+
contents: read
5+
pull-requests: write
6+
7+
on:
8+
pull_request:
9+
types: [ opened, edited ]
10+
11+
jobs:
12+
Assign-Label-To-Pull-Request:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/[email protected]
16+
with:
17+
repo-token: "${{ secrets.GITHUB_TOKEN }}"

.github/workflows/nexus-publish-snapshots.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,30 @@
22
# qbic-repo.qbic.uni-tuebingen.de packages when a release is created
33
# For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path
44

5-
name: Nexus Package
5+
name: Deploy Snapshot
66

77
on:
88
push:
99
branches:
1010
- development
11-
workflow_dispatch:
1211

1312
jobs:
14-
publish_snapshots:
13+
publish_snapshot:
1514

1615
runs-on: ubuntu-latest
1716

1817
steps:
19-
- uses: actions/checkout@v2
20-
- name: Set up JDK 1.8
21-
uses: actions/setup-java@v1
18+
- name: Checkout repository
19+
uses: actions/checkout@v3
20+
- name: Set up JDK 8
21+
uses: actions/setup-java@v3
2222
with:
23-
java-version: 1.8
24-
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
23+
distribution: 'zulu'
24+
java-version: '8'
2525
settings-path: ${{ github.workspace }}
26-
26+
2727
- name: Load local Maven repository cache
28-
uses: actions/cache@v2
28+
uses: actions/cache@v3
2929
with:
3030
path: ~/.m2/repository
3131
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
@@ -38,10 +38,10 @@ jobs:
3838
- name: Set version in Maven project
3939
run: mvn versions:set -DnewVersion='${project.version}-SNAPSHOT'
4040

41-
- name: Build compiled bundle with Maven
42-
run: mvn clean -B package --file pom.xml
41+
- name: Build with Maven
42+
run: mvn -B package --file pom.xml
4343

44-
- name: Publish compiled bundle to QBiC Nexus Repository
44+
- name: Publish artefact to QBiC Nexus Repository
4545
run: mvn --settings $GITHUB_WORKSPACE/.github.settings.xml deploy
4646
env:
4747
MAVEN_REPO_USERNAME: ${{ secrets.NEXUS_USERNAME }}

0 commit comments

Comments
 (0)