-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from com-pas/initial-structure
Initial setup/structure to build the project
- Loading branch information
Showing
53 changed files
with
2,702 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# SPDX-FileCopyrightText: 2022 Alliander N.V. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
version: 2 | ||
|
||
registries: | ||
maven-github: | ||
type: maven-repository | ||
url: https://maven.pkg.github.com/com-pas/* | ||
username: OWNER | ||
password: ${{ secrets.DB_GITHUB_PACKAGES }} | ||
|
||
updates: | ||
# Maintain dependencies for GitHub Actions | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
open-pull-requests-limit: 5 | ||
|
||
# Maintain dependencies for Maven | ||
- package-ecosystem: "maven" | ||
directory: "/" | ||
registries: | ||
- maven-github | ||
schedule: | ||
interval: "daily" | ||
open-pull-requests-limit: 5 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# SPDX-FileCopyrightText: 2022 Alliander N.V. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
changelog: | ||
exclude: | ||
labels: | ||
- wontfix | ||
- duplicate | ||
- invalid | ||
- ignore | ||
categories: | ||
- title: New Features | ||
labels: | ||
- enhancement | ||
- title: Bugfixes | ||
labels: | ||
- bug | ||
- title: Tooling changes | ||
labels: | ||
- tooling | ||
- title: Dependency updates | ||
labels: | ||
- dependencies | ||
- title: Other Changes | ||
labels: | ||
- "*" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# SPDX-FileCopyrightText: 2022 Alliander N.V. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: Add issues and pull request to project boards | ||
|
||
on: [ issues, pull_request, pull_request_target ] | ||
|
||
jobs: | ||
github-actions-automate-projects: | ||
runs-on: ubuntu-latest | ||
|
||
if: ${{ (github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]') || (github.actor == 'dependabot[bot]' && github.event_name == 'pull_request_target') }} | ||
steps: | ||
- name: add-new-issues-to-repository-based-project-column | ||
uses: docker://takanabe/github-actions-automate-projects:v0.0.1 | ||
if: github.event_name == 'issues' && github.event.action == 'opened' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITHUB_PROJECT_URL: https://github.com/com-pas/compas-scl-validator/projects/1 | ||
GITHUB_PROJECT_COLUMN_NAME: To do | ||
- name: add-new-pull-request-to-repository-based-project-column | ||
uses: docker://takanabe/github-actions-automate-projects:v0.0.1 | ||
if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && github.event.action == 'opened' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITHUB_PROJECT_URL: https://github.com/com-pas/compas-scl-validator/projects/1 | ||
GITHUB_PROJECT_COLUMN_NAME: To do | ||
- name: add-new-issues-to-organization-based-project-column | ||
uses: docker://takanabe/github-actions-automate-projects:v0.0.1 | ||
if: github.event_name == 'issues' && github.event.action == 'opened' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.ORG_GITHUB_ACTION_SECRET }} | ||
GITHUB_PROJECT_URL: https://github.com/orgs/com-pas/projects/1 | ||
GITHUB_PROJECT_COLUMN_NAME: To do | ||
- name: add-new-pull-request-to-organization-based-project-column | ||
uses: docker://takanabe/github-actions-automate-projects:v0.0.1 | ||
if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && github.event.action == 'opened' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.ORG_GITHUB_ACTION_SECRET }} | ||
GITHUB_PROJECT_URL: https://github.com/orgs/com-pas/projects/2 | ||
GITHUB_PROJECT_COLUMN_NAME: To do |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# SPDX-FileCopyrightText: 2022 Alliander N.V. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: Build Project | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
pull_request: | ||
branches: | ||
- 'main' | ||
- 'develop' | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: Cache Docker Register | ||
uses: actions/cache@v2 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ hashFiles('**/Dockerfile') }} | ||
- name: Cache Maven packages | ||
uses: actions/cache@v2.1.6 | ||
with: | ||
path: ~/.m2 | ||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: ${{ runner.os }}-m2 | ||
|
||
- name: Set up JDK 1.11 | ||
uses: actions/setup-java@v2.5.0 | ||
with: | ||
distribution: 'zulu' | ||
java-version: '11' | ||
|
||
- name: Create custom Maven Settings.xml | ||
uses: whelk-io/maven-settings-xml-action@v20 | ||
with: | ||
output_file: custom_maven_settings.xml | ||
servers: '[{ "id": "github-packages-compas", "username": "OWNER", "password": "${{ secrets.GITHUB_TOKEN }}" }]' | ||
- name: Build Native with Maven | ||
if: ${{ github.event_name == 'pull_request' }} | ||
run: ./mvnw -s custom_maven_settings.xml -B -Pnative clean verify | ||
- name: Build with Maven | ||
if: ${{ github.event_name == 'push' }} | ||
run: ./mvnw -s custom_maven_settings.xml -B clean verify |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# SPDX-FileCopyrightText: 2022 Alliander N.V. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: Release Project | ||
|
||
on: | ||
release: | ||
types: [released] | ||
|
||
jobs: | ||
push_to_registry: | ||
name: Build and publish | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_TOKEN }} | ||
- name: Cache Docker Register | ||
uses: actions/cache@v2 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ hashFiles('**/Dockerfile') }} | ||
- name: Cache Maven packages | ||
uses: actions/cache@v2.1.6 | ||
with: | ||
path: ~/.m2 | ||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: ${{ runner.os }}-m2 | ||
|
||
- name: Extract tag name | ||
id: extract_tagname | ||
shell: bash | ||
# Extra the tagname form the git reference, value of GITHUB_REF will be something like refs/tags/<tag_name>. | ||
run: echo "##[set-output name=tagname;]$(echo ${GITHUB_REF##*/})" | ||
- name: Set up JDK 1.11 | ||
uses: actions/setup-java@v2.5.0 | ||
with: | ||
distribution: 'zulu' | ||
java-version: '11' | ||
|
||
- name: Create custom Maven Settings.xml | ||
uses: whelk-io/maven-settings-xml-action@v20 | ||
with: | ||
output_file: custom_maven_settings.xml | ||
servers: '[{ "id": "github-packages-compas", "username": "OWNER", "password": "${{ secrets.GITHUB_TOKEN }}" }]' | ||
- name: Set version with Maven | ||
run: ./mvnw -B versions:set -DprocessAllModules=true -DnewVersion=${{ steps.extract_tagname.outputs.tagname }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Deploy with Maven to GitHub Packages and Docker Hub | ||
run: ./mvnw -B -s custom_maven_settings.xml -Prelease,native clean deploy | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# SPDX-FileCopyrightText: 2022 Alliander N.V. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: REUSE Compliance Check | ||
|
||
on: push | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: REUSE Compliance Check | ||
uses: fsfe/reuse-action@v1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# SPDX-FileCopyrightText: 2022 Alliander N.V. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: SonarCloud Analysis | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
pull_request: | ||
branches: | ||
- 'main' | ||
- 'develop' | ||
pull_request_target: | ||
branches: | ||
- 'main' | ||
- 'develop' | ||
|
||
jobs: | ||
build: | ||
name: SonarCloud | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
|
||
if: ${{ (github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]') || (github.actor == 'dependabot[bot]' && github.event_name == 'pull_request_target') }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up JDK 1.11 | ||
uses: actions/setup-java@v2.5.0 | ||
with: | ||
distribution: 'zulu' | ||
java-version: '11' | ||
- name: Cache SonarCloud packages | ||
uses: actions/cache@v2.1.6 | ||
with: | ||
path: ~/.sonar/cache | ||
key: ${{ runner.os }}-sonar | ||
restore-keys: ${{ runner.os }}-sonar | ||
- name: Cache Maven packages | ||
uses: actions/cache@v2.1.6 | ||
with: | ||
path: ~/.m2 | ||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: ${{ runner.os }}-m2 | ||
|
||
- name: Create custom Maven Settings.xml | ||
uses: whelk-io/maven-settings-xml-action@v20 | ||
with: | ||
output_file: custom_maven_settings.xml | ||
servers: '[{ "id": "github-packages-compas", "username": "OWNER", "password": "${{ secrets.GITHUB_TOKEN }}" }]' | ||
- name: Build and analyze | ||
env: | ||
GITHUB_USERNAME: "OWNER" | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
run: | | ||
./mvnw -s custom_maven_settings.xml -B -Psonar \ | ||
-Dsonar.projectKey=com-pas_compas-scl-validator \ | ||
-Dsonar.organization=com-pas \ | ||
-Dsonar.host.url=https://sonarcloud.io \ | ||
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \ | ||
clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar |
Oops, something went wrong.