Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .containerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/node_modules/**
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
54 changes: 54 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#
# Copyright (C) 2025 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0

# Set update schedule for GitHub Actions

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
time: "16:00"
open-pull-requests-limit: 20

- package-ecosystem: "npm"
directory: "/"
schedule:
interval: daily
time: "16:00"
open-pull-requests-limit: 20
groups:
commitlint:
applies-to: version-updates
patterns:
- "@commitlint/*"
eslint:
applies-to: version-updates
patterns:
- "eslint"
- "@eslint/*"
typescript-eslint:
applies-to: version-updates
patterns:
- "@typescript-eslint/*"
- "typescript-eslint"
vitest:
applies-to: version-updates
patterns:
- "@vitest/*"
- "vitest"
151 changes: 151 additions & 0 deletions .github/workflows/next-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
#
# Copyright (C) 2025 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0

name: build and publish next image

permissions:
contents: read
packages: write
attestations: write
id-token: write

on:
workflow_dispatch:
push:
branches:
- main

jobs:
check-builder-changes:
runs-on: ubuntu-24.04
outputs:
builder_required: ${{ steps.check.outputs.builder_required }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 2 # Ensure we have at least one previous commit for diff check

- name: Check for builder-related changes
id: check
run: |
if git diff --name-only HEAD^ HEAD | grep -E '^(package.json|pnpm-lock.yaml|build/Containerfile.builder|.github/workflows/next-build.yaml)$'; then
echo "builder_required=true" >> $GITHUB_OUTPUT
else
echo "builder_required=false" >> $GITHUB_OUTPUT
fi

builder-image:
needs: check-builder-changes
if: needs.check-builder-changes.outputs.builder_required == 'true'
name: Build and publish builder OCI images only if pnpm-lock.yaml or package.json changes
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install qemu dependency
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static

- name: build builder image
id: builder-image
uses: redhat-actions/buildah-build@v2
with:
image: podman-desktop-extension-kubernetes-dashboard-builder
tags: next ${{ github.sha }}
platforms: linux/amd64, linux/arm64
containerfiles: |
build/Containerfile.builder
context: .
oci: true

- name: Log in to ghcr.io
uses: redhat-actions/podman-login@v1
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io

- name: publish builder to ghcr.io
id: push-to-ghcr
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.builder-image.outputs.image }}
tags: ${{ steps.builder-image.outputs.tags }}
registry: ghcr.io/${{ github.repository_owner }}

- name: Generate artifact attestation
uses: actions/attest-build-provenance@v2
with:
subject-name: ghcr.io/${{ github.repository_owner }}/podman-desktop-extension-kubernetes-dashboard-builder
subject-digest: ${{ steps.push-to-ghcr.outputs.digest }}
push-to-registry: true


extension-image:
name: Build and publish extension OCI image
if: always()
runs-on: ubuntu-24.04
needs: builder-image

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install qemu dependency
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static

- name: build extension image
id: extension-image
uses: redhat-actions/buildah-build@v2
with:
image: podman-desktop-extension-kubernetes-dashboard
tags: next ${{ github.sha }}
archs: amd64, arm64
containerfiles: |
build/Containerfile
context: .
oci: true

- name: Log in to ghcr.io
uses: redhat-actions/podman-login@v1
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io

- name: publish extension to ghcr.io
id: push-to-ghcr
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.extension-image.outputs.image }}
tags: ${{ steps.extension-image.outputs.tags }}
registry: ghcr.io/${{ github.repository_owner }}

- name: Generate artifact attestation
uses: actions/attest-build-provenance@v2
with:
subject-name: ghcr.io/${{ github.repository_owner }}/podman-desktop-extension-kubernetes-dashboard
subject-digest: ${{ steps.push-to-ghcr.outputs.digest }}
push-to-registry: true
70 changes: 70 additions & 0 deletions .github/workflows/pr-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#
# Copyright (C) 2025 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0

name: pr-check

permissions:
contents: read

on: [pull_request]

jobs:
build:
name: Build / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: "windows-2022"
- os: "macos-14"
- os: "ubuntu-24.04"
timeout-minutes: 20
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false

- uses: actions/setup-node@v4
with:
node-version: 22
cache: 'pnpm'

- name: Execute pnpm
run: pnpm install --frozen-lockfile

- name: Run typecheck
run: pnpm typecheck

# skip formatter on windows
- name: Run formatter
if: ${{ matrix.os=='ubuntu-24.04' || matrix.os=='macos-14' }}
run: pnpm format:check

- name: Run linter
run: pnpm lint:check

- name: Run tests
run: pnpm test

- name: Run build
run: pnpm build
timeout-minutes: 40
Loading