Skip to content

Commit

Permalink
Update GitHub Actions (#21)
Browse files Browse the repository at this point in the history
Updates all actions to the latest version using node.js 16.
The label action was replaced by a maintained action.
  • Loading branch information
KochTobi authored Jun 1, 2023
1 parent bba1f95 commit 62248c8
Show file tree
Hide file tree
Showing 15 changed files with 261 additions and 247 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @qbicsoftware/itss
27 changes: 19 additions & 8 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates_configs:
- package_manager: "java:maven"
directory: "/"
update_schedule: "daily"
target-branch: development
default_labels: "dependabot"
commit-message:
prefix: "[DEPENDABOT]"
updates:
- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
- package-ecosystem: "maven"
directory: "/"
schedule:
interval: "daily"
target-branch: "development"
labels:
- "dependabot"
commit-message:
prefix: "[DEPENDABOT]"
13 changes: 13 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
feature:
- any:
- head-branch: [ '^feature' ]
fix:
- any:
- head-branch: [ '^fix', '^hotfix' ]
chore:
- any:
- head-branch: [ '^chore', '^documentation', '^docs', '^ci', '^refactor' ]
release:
- all:
- base-branch: [ 'main', 'master' ]
- head-branch: [ 'development', 'dev' ]
20 changes: 20 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
changelog:
exclude:
labels:
- ignore-for-release
authors:
- JohnnyQ5
- github-actions
categories:
- title: New Features 🚀
labels:
- feature
- title: Bugfixes 🪲
labels:
- fix
- title: Documentation & CI 🪂
labels:
- chore
- title: Others 🧃
labels:
- "*"
28 changes: 21 additions & 7 deletions .github/workflows/build_package.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
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:
build:
package:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: 1.8

distribution: 'zulu'
java-version: '8'
- name: Load local Maven repository cache
uses: actions/cache@v3
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
16 changes: 0 additions & 16 deletions .github/workflows/changelog-update.yml

This file was deleted.

80 changes: 40 additions & 40 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,15 @@ name: "CodeQL"

on:
push:
branches: [ master, development, patch/*, release/*, hotfix/* ]
branches: [ main, master, development, release/*, hotfix/* ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
branches: [ main, master ]
schedule:
- cron: '21 1 * * 4'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
Expand All @@ -37,47 +36,48 @@ jobs:
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
settings-path: ${{ github.workspace }}
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '8'
settings-path: ${{ github.workspace }}

- 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: Load local Maven repository cache
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

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

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

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

#- run: |
# make bootstrap
# make release
#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
98 changes: 98 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Create Release

on:
workflow_dispatch:
inputs:
versionTag:
description: 'Version Tag (semantic version)'
required: true

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '8'
settings-path: ${{ github.workspace }}

- name: Load local Maven repository cache
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up git
run: |
git config --global user.email "[email protected]"
git config --global user.name "JohnnyQ5"
- name: Set version in Maven project
run: mvn versions:set -DnewVersion=${{ github.event.inputs.versionTag }}

- name: Build with Maven
run: mvn -B package --file pom.xml

- name: Create Release Notes
if: ${{ !startsWith(github.ref, 'refs/tags/')
&& !( contains(github.event.inputs.versionTag, 'alpha')
|| contains(github.event.inputs.versionTag, 'beta')
|| contains(github.event.inputs.versionTag, 'rc')) }}
uses: actions/github-script@v6
with:
github-token: ${{secrets.JOHNNY_Q5_REPORTS_TOKEN}}
script: |
await github.request(`POST /repos/${{ github.repository }}/releases`, {
tag_name: "${{ github.event.inputs.versionTag }}",
generate_release_notes: true
});
- name: Create Pre-Release Notes
if: ${{ !startsWith(github.ref, 'refs/tags/')
&& ( contains(github.event.inputs.versionTag, 'alpha')
|| contains(github.event.inputs.versionTag, 'beta')
|| contains(github.event.inputs.versionTag, 'rc')) }}
uses: actions/github-script@v6
with:
github-token: ${{secrets.JOHNNY_Q5_REPORTS_TOKEN}}
script: |
await github.request(`POST /repos/${{ github.repository }}/releases`, {
tag_name: "${{ github.event.inputs.versionTag }}",
generate_release_notes: true,
prerelease: true
});
- name: Publish artefact to QBiC Nexus Repository
run: mvn --quiet --settings $GITHUB_WORKSPACE/.github.settings.xml deploy
env:
MAVEN_REPO_USERNAME: ${{ secrets.NEXUS_USERNAME }}
MAVEN_REPO_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}

- 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: Push to Github
run: git push

- name: Open PR with version bump
uses: actions/github-script@v6
with:
github-token: ${{secrets.JOHNNY_Q5_REPORTS_TOKEN}}
script: |
await github.request(`POST /repos/${{ github.repository }}/pulls`, {
title: 'Update version to ${{ github.event.inputs.versionTag }}',
head: 'release/set-version-to-${{ github.event.inputs.versionTag }}',
base: 'main'
});
61 changes: 0 additions & 61 deletions .github/workflows/generate-reports.yml

This file was deleted.

Loading

0 comments on commit 62248c8

Please sign in to comment.