Skip to content

Commit

Permalink
Add alternative GitHub Workflows (#11)
Browse files Browse the repository at this point in the history
* add local analysis and release as github workflows

* fix gradle action template

---------

Co-authored-by: Robert Haimerl <[email protected]>
  • Loading branch information
CodingDepot and Robert Haimerl authored Jul 26, 2024
1 parent f11d9bb commit 01e4fe5
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/local-analysis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: "Codacy Local Analysis"

on: push

jobs:
analyze:
name: analyze
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- uses: gradle/actions/setup-gradle@v3
with:
gradle-version: 8.9
- name: build
run: gradle build
- name: generate coverage report
run: gradle jacocoTestReport
- name: uploade coverage data
uses: codacy/[email protected]
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: reports/coverage.xml
- name: generate and upload local analysis data
uses: codacy/[email protected]
with:
tool: spotbugs
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
upload: true
43 changes: 43 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "Release and Attest"

on:
push:
tags:
- 'v*.*.*'

jobs:
create-release:
name: create-release
runs-on: ubuntu-latest
permissions:
contents: read
attestations: write
id-token: write
steps:
- uses: actions/checkout@v4
- name: insert newrelic key
run: sed -i "s|<LICENSE_KEY>|${{ secrets.NEWRELIC_LICENSE_KEY }}|g" newrelic.yml
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
tags: type=semver,pattern={{version}}
images: codingdepot/idp-target-registry
- name: Build and push
id: push
uses: docker/build-push-action@v6
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true

0 comments on commit 01e4fe5

Please sign in to comment.