Skip to content

Commit b85c285

Browse files
committed
feat: initial project structure
Signed-off-by: Philippe Martin <[email protected]>
1 parent 28aa424 commit b85c285

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+9079
-0
lines changed

.containerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**/node_modules/**

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.github/dependabot.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#
2+
# Copyright (C) 2025 Red Hat, Inc.
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+
# SPDX-License-Identifier: Apache-2.0
17+
18+
# Set update schedule for GitHub Actions
19+
20+
version: 2
21+
updates:
22+
- package-ecosystem: "github-actions"
23+
directory: "/"
24+
schedule:
25+
interval: "daily"
26+
time: "16:00"
27+
open-pull-requests-limit: 20
28+
29+
- package-ecosystem: "npm"
30+
directory: "/"
31+
schedule:
32+
interval: daily
33+
time: "16:00"
34+
open-pull-requests-limit: 20
35+
groups:
36+
commitlint:
37+
applies-to: version-updates
38+
patterns:
39+
- "@commitlint/*"
40+
eslint:
41+
applies-to: version-updates
42+
patterns:
43+
- "eslint"
44+
- "@eslint/*"
45+
typescript-eslint:
46+
applies-to: version-updates
47+
patterns:
48+
- "@typescript-eslint/*"
49+
- "typescript-eslint"
50+
vitest:
51+
applies-to: version-updates
52+
patterns:
53+
- "@vitest/*"
54+
- "vitest"

.github/workflows/next-build.yaml

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
#
2+
# Copyright (C) 2025 Red Hat, Inc.
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+
# SPDX-License-Identifier: Apache-2.0
17+
18+
name: build and publish next image
19+
20+
permissions:
21+
contents: read
22+
packages: write
23+
attestations: write
24+
id-token: write
25+
26+
on:
27+
workflow_dispatch:
28+
push:
29+
branches:
30+
- main
31+
32+
jobs:
33+
check-builder-changes:
34+
runs-on: ubuntu-24.04
35+
outputs:
36+
builder_required: ${{ steps.check.outputs.builder_required }}
37+
steps:
38+
- name: Checkout Repository
39+
uses: actions/checkout@v4
40+
with:
41+
fetch-depth: 2 # Ensure we have at least one previous commit for diff check
42+
43+
- name: Check for builder-related changes
44+
id: check
45+
run: |
46+
if git diff --name-only HEAD^ HEAD | grep -E '^(package.json|pnpm-lock.yaml|build/Containerfile.builder|.github/workflows/next-build.yaml)$'; then
47+
echo "builder_required=true" >> $GITHUB_OUTPUT
48+
else
49+
echo "builder_required=false" >> $GITHUB_OUTPUT
50+
fi
51+
52+
builder-image:
53+
needs: check-builder-changes
54+
if: needs.check-builder-changes.outputs.builder_required == 'true'
55+
name: Build and publish builder OCI images only if pnpm-lock.yaml or package.json changes
56+
runs-on: ubuntu-24.04
57+
58+
steps:
59+
- uses: actions/checkout@v4
60+
with:
61+
fetch-depth: 0
62+
63+
- name: Install qemu dependency
64+
run: |
65+
sudo apt-get update
66+
sudo apt-get install -y qemu-user-static
67+
68+
- name: build builder image
69+
id: builder-image
70+
uses: redhat-actions/buildah-build@v2
71+
with:
72+
image: podman-desktop-extension-kubernetes-dashboard-builder
73+
tags: next ${{ github.sha }}
74+
platforms: linux/amd64, linux/arm64
75+
containerfiles: |
76+
build/Containerfile.builder
77+
context: .
78+
oci: true
79+
80+
- name: Log in to ghcr.io
81+
uses: redhat-actions/podman-login@v1
82+
with:
83+
username: ${{ github.actor }}
84+
password: ${{ secrets.GITHUB_TOKEN }}
85+
registry: ghcr.io
86+
87+
- name: publish builder to ghcr.io
88+
id: push-to-ghcr
89+
uses: redhat-actions/push-to-registry@v2
90+
with:
91+
image: ${{ steps.builder-image.outputs.image }}
92+
tags: ${{ steps.builder-image.outputs.tags }}
93+
registry: ghcr.io/${{ github.repository_owner }}
94+
95+
- name: Generate artifact attestation
96+
uses: actions/attest-build-provenance@v2
97+
with:
98+
subject-name: ghcr.io/${{ github.repository_owner }}/podman-desktop-extension-kubernetes-dashboard-builder
99+
subject-digest: ${{ steps.push-to-ghcr.outputs.digest }}
100+
push-to-registry: true
101+
102+
103+
extension-image:
104+
name: Build and publish extension OCI image
105+
if: always()
106+
runs-on: ubuntu-24.04
107+
needs: builder-image
108+
109+
steps:
110+
- uses: actions/checkout@v4
111+
with:
112+
fetch-depth: 0
113+
114+
- name: Install qemu dependency
115+
run: |
116+
sudo apt-get update
117+
sudo apt-get install -y qemu-user-static
118+
119+
- name: build extension image
120+
id: extension-image
121+
uses: redhat-actions/buildah-build@v2
122+
with:
123+
image: podman-desktop-extension-kubernetes-dashboard
124+
tags: next ${{ github.sha }}
125+
archs: amd64, arm64
126+
containerfiles: |
127+
build/Containerfile
128+
context: .
129+
oci: true
130+
131+
- name: Log in to ghcr.io
132+
uses: redhat-actions/podman-login@v1
133+
with:
134+
username: ${{ github.actor }}
135+
password: ${{ secrets.GITHUB_TOKEN }}
136+
registry: ghcr.io
137+
138+
- name: publish extension to ghcr.io
139+
id: push-to-ghcr
140+
uses: redhat-actions/push-to-registry@v2
141+
with:
142+
image: ${{ steps.extension-image.outputs.image }}
143+
tags: ${{ steps.extension-image.outputs.tags }}
144+
registry: ghcr.io/${{ github.repository_owner }}
145+
146+
- name: Generate artifact attestation
147+
uses: actions/attest-build-provenance@v2
148+
with:
149+
subject-name: ghcr.io/${{ github.repository_owner }}/podman-desktop-extension-kubernetes-dashboard
150+
subject-digest: ${{ steps.push-to-ghcr.outputs.digest }}
151+
push-to-registry: true

.github/workflows/pr-check.yaml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#
2+
# Copyright (C) 2025 Red Hat, Inc.
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+
# SPDX-License-Identifier: Apache-2.0
17+
18+
name: pr-check
19+
20+
permissions:
21+
contents: read
22+
23+
on: [pull_request]
24+
25+
jobs:
26+
build:
27+
name: Build / ${{ matrix.os }}
28+
runs-on: ${{ matrix.os }}
29+
strategy:
30+
matrix:
31+
include:
32+
- os: "windows-2022"
33+
- os: "macos-14"
34+
- os: "ubuntu-24.04"
35+
timeout-minutes: 20
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
steps:
39+
- uses: actions/checkout@v4
40+
41+
- uses: pnpm/action-setup@v4
42+
name: Install pnpm
43+
with:
44+
run_install: false
45+
46+
- uses: actions/setup-node@v4
47+
with:
48+
node-version: 22
49+
cache: 'pnpm'
50+
51+
- name: Execute pnpm
52+
run: pnpm install --frozen-lockfile
53+
54+
- name: Run typecheck
55+
run: pnpm typecheck
56+
57+
# skip formatter on windows
58+
- name: Run formatter
59+
if: ${{ matrix.os=='ubuntu-24.04' || matrix.os=='macos-14' }}
60+
run: pnpm format:check
61+
62+
- name: Run linter
63+
run: pnpm lint:check
64+
65+
- name: Run tests
66+
run: pnpm test
67+
68+
- name: Run build
69+
run: pnpm build
70+
timeout-minutes: 40

0 commit comments

Comments
 (0)