Skip to content

Commit 01e4fe5

Browse files
CodingDepotRobert Haimerl
and
Robert Haimerl
authored
Add alternative GitHub Workflows (#11)
* add local analysis and release as github workflows * fix gradle action template --------- Co-authored-by: Robert Haimerl <[email protected]>
1 parent f11d9bb commit 01e4fe5

File tree

2 files changed

+75
-0
lines changed

2 files changed

+75
-0
lines changed

.github/workflows/local-analysis.yaml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: "Codacy Local Analysis"
2+
3+
on: push
4+
5+
jobs:
6+
analyze:
7+
name: analyze
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- uses: actions/setup-java@v4
12+
with:
13+
distribution: temurin
14+
java-version: 17
15+
- uses: gradle/actions/setup-gradle@v3
16+
with:
17+
gradle-version: 8.9
18+
- name: build
19+
run: gradle build
20+
- name: generate coverage report
21+
run: gradle jacocoTestReport
22+
- name: uploade coverage data
23+
uses: codacy/[email protected]
24+
with:
25+
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
26+
coverage-reports: reports/coverage.xml
27+
- name: generate and upload local analysis data
28+
uses: codacy/[email protected]
29+
with:
30+
tool: spotbugs
31+
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
32+
upload: true

.github/workflows/release.yaml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: "Release and Attest"
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
jobs:
9+
create-release:
10+
name: create-release
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
attestations: write
15+
id-token: write
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: insert newrelic key
19+
run: sed -i "s|<LICENSE_KEY>|${{ secrets.NEWRELIC_LICENSE_KEY }}|g" newrelic.yml
20+
- name: Login to Docker Hub
21+
uses: docker/login-action@v3
22+
with:
23+
username: ${{ secrets.DOCKERHUB_USERNAME }}
24+
password: ${{ secrets.DOCKERHUB_TOKEN }}
25+
- name: Extract metadata (tags, labels) for Docker
26+
id: meta
27+
uses: docker/metadata-action@v5
28+
with:
29+
tags: type=semver,pattern={{version}}
30+
images: codingdepot/idp-target-registry
31+
- name: Build and push
32+
id: push
33+
uses: docker/build-push-action@v6
34+
with:
35+
push: true
36+
tags: ${{ steps.meta.outputs.tags }}
37+
labels: ${{ steps.meta.outputs.labels }}
38+
- name: Generate artifact attestation
39+
uses: actions/attest-build-provenance@v1
40+
with:
41+
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
42+
subject-digest: ${{ steps.push.outputs.digest }}
43+
push-to-registry: true

0 commit comments

Comments
 (0)