Skip to content

Commit 608139d

Browse files
committed
Enable github action
* disable Jenkinsfile * Add github dependabot * Add PR build & merge build github action
1 parent 33f2d67 commit 608139d

5 files changed

Lines changed: 162 additions & 0 deletions

File tree

.github/dependabot.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
version: 2
6+
updates:
7+
- package-ecosystem: "maven" # See documentation for possible values
8+
directory: "/" # Location of package manifests
9+
schedule:
10+
interval: "weekly"
11+
12+
- package-ecosystem: "github-actions" # Also update Github actions
13+
directory: "/"
14+
schedule:
15+
# Check for updates to GitHub Actions every week
16+
interval: "weekly"

.github/workflows/merge-build.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
#
2+
# Copyright (C) 2022-2023 Red Hat, Inc. (https://github.com/Commonjava/gateway)
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
# This workflow will build a Java project with Maven
18+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
19+
20+
name: Merge / Push Build
21+
22+
on:
23+
push:
24+
branches:
25+
- 'master'
26+
27+
jobs:
28+
publish-snapshot:
29+
name: Build & push image
30+
31+
runs-on: ubuntu-latest
32+
33+
permissions:
34+
contents: read
35+
packages: write
36+
37+
env:
38+
MAVEN_OPTS: "-Xmx4096m -Xms2048m -XX:MaxMetaspaceSize=4096m -Xss8m"
39+
40+
steps:
41+
- uses: actions/checkout@v6
42+
43+
- name: Set up JDK
44+
uses: actions/setup-java@v5
45+
with:
46+
distribution: 'temurin'
47+
architecture: x64
48+
java-version: 17
49+
50+
- name: maven-settings-xml-action
51+
uses: whelk-io/maven-settings-xml-action@v22
52+
with:
53+
repositories: '[{ "id": "sonatype", "url": "https://oss.sonatype.org/content/repositories/snapshots/", "releases": {"enabled": "false"}, "snapshots": {"enabled": "true" }}]'
54+
55+
- name: "Maven Verify"
56+
if: ${{ github.event.repository.fork == true }}
57+
run: mvn -B -e verify
58+
59+
- name: "Maven Build"
60+
if: ${{ github.event.repository.fork == false }}
61+
run: mvn -B -e clean install
62+
63+
- name: Checkout tools repo
64+
uses: actions/checkout@v6
65+
with:
66+
repository: Commonjava/commonjava-images
67+
path: commonjava-images
68+
69+
- name: Locate artifacts
70+
id: locate-artifacts
71+
run: |
72+
tarball=$(ls -d $PWD/target/*-runner.jar)
73+
cp "$tarball" "commonjava-images/indy-repository-service/indy-repository-service-runner.jar"
74+
75+
- name: Log in to Quay.io
76+
uses: redhat-actions/podman-login@v1
77+
with:
78+
username: ${{ secrets.QUAY_USERNAME }}
79+
password: ${{ secrets.QUAY_ROBOT_TOKEN }}
80+
registry: quay.io
81+
82+
- name: Buildah build
83+
id: buildah-build
84+
uses: redhat-actions/buildah-build@v2
85+
with:
86+
image: indy-repository-service
87+
tags: ${{ github.ref_name }}
88+
platforms: linux/amd64
89+
containerfiles: |
90+
commonjava-images/indy-repository-service/actions.Dockerfile
91+
context: commonjava-images/indy-repository-service/
92+
93+
- name: Push To quay.io
94+
id: push-to-quay
95+
uses: redhat-actions/push-to-registry@v2
96+
with:
97+
image: ${{ steps.buildah-build.outputs.image }}
98+
tags: ${{ steps.buildah-build.outputs.tags }}
99+
registry: quay.io/factory2

.github/workflows/pr-build.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#
2+
# Copyright (C) 2022-2023 Red Hat, Inc. (https://github.com/Commonjava/gateway)
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
# This workflow will build a Java project with Maven
18+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
19+
20+
name: PR Build
21+
22+
on: [pull_request]
23+
24+
jobs:
25+
build:
26+
27+
runs-on: ubuntu-latest
28+
29+
steps:
30+
- uses: actions/checkout@v6
31+
32+
- name: Set up JDK 17 for x64
33+
uses: actions/setup-java@v5
34+
with:
35+
java-version: '17'
36+
distribution: 'temurin'
37+
architecture: x64
38+
39+
- name: maven-settings-xml-action
40+
uses: whelk-io/maven-settings-xml-action@v22
41+
with:
42+
repositories: '[{ "id": "sonatype", "url": "https://oss.sonatype.org/content/repositories/snapshots/", "releases": {"enabled": "false"}, "snapshots": {"enabled": "true" }}]'
43+
44+
- name: Build with Maven
45+
run: mvn -B -e verify

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,5 @@ hs_err_pid*
4444

4545
# cache is generated folder
4646
cache/
47+
48+
config/
File renamed without changes.

0 commit comments

Comments
 (0)