Skip to content

Commit

Permalink
Merge branch 'open-component-model:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
vasu1124 authored Jun 3, 2024
2 parents 222b43b + 7a913dc commit 7c97d66
Show file tree
Hide file tree
Showing 2,016 changed files with 15,214 additions and 12,059 deletions.
37 changes: 37 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
.github
.reuse
.vscode
.idea
.project
.settings

bin

/cmds/demoplugin
/cmds/ecrplugin
/cmds/helminstaller
/cmds/test
/components/demoplugin
/components/ecrplugin
/components/helmdemo
/components/helminstaller
/components/subchartsdemo

/docs
/examples
/hack
/LICENSES
/local

/pkg/test*

/testdata
/tmp

.*
*.exe
*.md
**/Dockerfile

!go.*
!**/*.go
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ updates:
- "*"
schedule:
interval: "weekly"
day: "sunday"
day: "friday"
- package-ecosystem: "gomod"
directory: "/"
groups:
Expand Down
1 change: 1 addition & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Please include a summary of the changes and the related issue. Please also inclu
## What type of PR is this? (check all applicable)

- [ ] 🍕 Feature
- [ ] 🎇 Restructuring
- [ ] 🐛 Bug Fix
- [ ] 📝 Documentation Update
- [ ] 🎨 Style
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/blackduck_scan_scheduled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,14 @@ jobs:
with:
java-version: '17'
distribution: 'temurin'

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: '${{ github.workspace }}/go.mod'

- name: Blackduck Full Scan
uses: mercedesbenzio/detect-action@v1
uses: mercedesbenzio/detect-action@v2
env:
DETECT_PROJECT_USER_GROUPS: opencomponentmodel
DETECT_PROJECT_VERSION_DISTRIBUTION: SAAS
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/buildcomponents.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ jobs:
packages: write
repository-projects: read
steps:
- name: Self Hosted Runner Post Job Cleanup Action
uses: TooMuch4U/[email protected]

- name: Checkout
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -63,4 +66,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: ocm.ctf
path: gen/ctf
path: gen/ctf
95 changes: 95 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '26 14 * * 2'

jobs:
analyze:
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
# required for all workflows
security-events: write

# required to fetch internal or private CodeQL packs
packages: read

# only required for workflows in private repositories
actions: read
contents: read

strategy:
fail-fast: false
matrix:
include:
- language: go
build-mode: autobuild
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Self Hosted Runner Post Job Cleanup Action
uses: TooMuch4U/[email protected]

- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# 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.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
7 changes: 7 additions & 0 deletions .github/workflows/components.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
run: |
cd components/ocmcli
PATH=$PATH:$(go env GOPATH)/bin make ctf
build-helminstaller:
name: Build HelmInstaller
runs-on: large_runner
Expand All @@ -65,6 +66,7 @@ jobs:
run: |
cd components/helminstaller
PATH=$PATH:$(go env GOPATH)/bin make ctf
build-helmdemo:
name: Build HelmDemo
runs-on: large_runner
Expand All @@ -91,6 +93,7 @@ jobs:
run: |
cd components/helmdemo
PATH=$PATH:$(go env GOPATH)/bin make ctf
build-subchartsdemo:
name: Build Helm SubChartsDemo
runs-on: large_runner
Expand All @@ -117,10 +120,14 @@ jobs:
run: |
cd components/subchartsdemo
PATH=$PATH:$(go env GOPATH)/bin make ctf
build-ecrplugin:
name: Build ECR Plugin
runs-on: large_runner
steps:
- name: Self Hosted Runner Post Job Cleanup Action
uses: TooMuch4U/[email protected]

- name: Checkout
uses: actions/checkout@v4
with:
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/lint_and_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ jobs:
- name: Unit test
run: |
PATH=$PATH:$(go env GOPATH)/bin make build
PATH=$PATH:$(go env GOPATH)/bin make test
PATH=$PATH:$(go env GOPATH)/bin make test-all
lint:
name: Lint
runs-on: large_runner
Expand Down Expand Up @@ -71,10 +72,14 @@ jobs:
- name: Lint
run: |
PATH=$PATH:$(go env GOPATH)/bin make check
generate:
name: DeepCopy verification
runs-on: large_runner
steps:
- name: Self Hosted Runner Post Job Cleanup Action
uses: TooMuch4U/[email protected]

- name: Checkout
uses: actions/checkout@v4
with:
Expand All @@ -99,3 +104,4 @@ jobs:
- name: Check for diff
run: |
git diff --exit-code --shortstat
2 changes: 1 addition & 1 deletion .github/workflows/pr_run_inttest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
private_key: ${{ secrets.OCMBOT_PRIV_KEY }}
- name: Repository Dispatch
if: github.event.pull_request.head.repo.fork == false
uses: myrotvorets/[email protected].0
uses: myrotvorets/[email protected].2
with:
token: ${{ steps.generate_token.outputs.token }} # metadata:read and contents:read&write
repo: open-component-model/ocm-integrationtest
Expand Down
73 changes: 73 additions & 0 deletions .github/workflows/push_ocm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: publish as latest
on:
# publish on pushes to the main branch (image tagged as "latest")
# https://github.com/open-component-model/ocm/pkgs/container/ocm
push:
branches:
- main

jobs:
docker_publish:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
packages: write

steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.OCMBOT_APP_ID }}
private_key: ${{ secrets.OCMBOT_PRIV_KEY }}

- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.generate_token.outputs.token }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Docker Login
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}
- name: Go Build Cache for Docker
uses: actions/cache@v4
with:
path: go-build-cache
key: ${{ runner.os }}-go-build-cache-${{ hashFiles('**/go.sum') }}

- name: inject go-build-cache into docker
uses: reproducible-containers/buildkit-cache-dance@v3
with:
cache-source: go-build-cache

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
# supported platforms of https://hub.docker.com/_/golang/tags?page=1&name=1.22-alpine3.19
# platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x
push: true
tags: |
ghcr.io/open-component-model/ocm:latest
ghcr.io/open-component-model/ocm/ocm.software/ocmcli/ocmcli-image:latest
${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
11 changes: 8 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ jobs:
id-token: write
packages: write
steps:
- name: Self Hosted Runner Post Job Cleanup Action
uses: TooMuch4U/[email protected]
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v2
Expand All @@ -140,10 +142,10 @@ jobs:
go-version-file: '${{ github.workspace }}/go.mod'

- name: Setup Syft
uses: anchore/sbom-action/download-syft@b6a39da80722a2cb0ef5d197531764a89b5d48c3 # v0.15.8
uses: anchore/sbom-action/download-syft@e8d2a6937ecead383dfe75190d104edd1f9c5751 # v0.16.0

- name: Setup Cosign
uses: sigstore/cosign-installer@v3.4.0
uses: sigstore/cosign-installer@v3.5.0

- name: Setup git config
run: |
Expand Down Expand Up @@ -191,6 +193,7 @@ jobs:
- name: Update Release Notes File
env:
RELEASE_NOTES: ${{ steps.release-notes.outputs.body }}
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
run: |
if git ls-remote --exit-code origin refs/tags/${{ env.RELEASE_VERSION }}; then
>&2 echo "tag ${{ env.RELEASE_VERSION }} already exists"
Expand All @@ -210,8 +213,10 @@ jobs:
fi
- name: Create and Push Release
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
run: |
git checkout --detach HEAD
# git checkout --detach HEAD
echo -n "${RELEASE_VERSION#v}" > VERSION
git add VERSION
git commit -m "Release $RELEASE_VERSION"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ bin/
go.mod.bak
dist/
.cache_ggshield
.DS_Store
3 changes: 3 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ linters-settings:
line-length: 120
gosec:
exclude-generated: true
gocritic:
disabled-checks:
- elseif

issues:
exclude:
Expand Down
Loading

0 comments on commit 7c97d66

Please sign in to comment.