From 379ee34b8692978e3068e1bce453e6b0f167db06 Mon Sep 17 00:00:00 2001 From: Schamper <1254028+Schamper@users.noreply.github.com> Date: Fri, 12 Jul 2024 20:01:26 +0200 Subject: [PATCH 1/7] Add devcontainer configuration and CI --- .devcontainer/devcontainer.json | 45 +++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 30 ++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 .devcontainer/devcontainer.json create mode 100644 .github/workflows/release.yml diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..4304d9a --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,45 @@ +{ + "name": "Dissect", + "image": "python:3.11-bullseye", + "features": { + "ghcr.io/devcontainers/features/common-utils:2": { + "installZsh": "true", + "configureZshAsDefaultShell": "true", + "username": "user", + "userUid": "1000", + "userGid": "1000", + "upgradePackages": "true" + }, + "ghcr.io/devcontainers/features/python:1": { + "toolsToInstall": "tox" + }, + "ghcr.io/devcontainers/features/git-lfs:1": { + "autoPull": true, + "version": "latest" + } + }, + "customizations": { + "vscode": { + "extensions": [ + "charliermarsh.ruff" + ], + "settings": { + "python.analysis.autoImportCompletions": true, + "python.analysis.indexing": true, + "python.analysis.inlayHints.functionReturnTypes": true, + "python.analysis.packageIndexDepths": [ + { + "name": "dissect", + "depth": 69, + "includeAllSymbols": true + } + ], + "[python]": { + "editor.formatOnSave": true, + "editor.defaultFormatter": "charliermarsh.ruff" + } + } + } + }, + "remoteUser": "user" +} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..5838690 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,30 @@ +name: "Release devcontainer image" +on: + workflow_dispatch: + +jobs: + deploy: + if: ${{ github.ref == 'refs/heads/main' }} + runs-on: ubuntu-latest + steps: + - name: Checkout (GitHub) + uses: actions/checkout@v4 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Pre-build and publish dev container image + uses: devcontainers/ci@v0.3 + with: + imageName: ghcr.io/fox-it/dissect-devcontainer + cacheFrom: ghcr.io/fox-it/dissect-devcontainer + push: filter + refFilterForPush: refs/heads/main + eventFilterForPush: | + workflow_dispatch + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From ca3176f6c4ccfac12153a40b080eb409af5ef386 Mon Sep 17 00:00:00 2001 From: Erik Schamper <1254028+Schamper@users.noreply.github.com> Date: Wed, 21 May 2025 14:27:05 +0000 Subject: [PATCH 2/7] Update image --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 4304d9a..79d5588 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,6 +1,6 @@ { "name": "Dissect", - "image": "python:3.11-bullseye", + "image": "python:3.13-bookworm", "features": { "ghcr.io/devcontainers/features/common-utils:2": { "installZsh": "true", From 2115b58394719b46ec8d82f73ef23d7136a97586 Mon Sep 17 00:00:00 2001 From: Erik Schamper <1254028+Schamper@users.noreply.github.com> Date: Wed, 21 May 2025 16:27:36 +0200 Subject: [PATCH 3/7] Update .github/workflows/release.yml Co-authored-by: Miauwkeru --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5838690..2ef0887 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,8 @@ name: "Release devcontainer image" on: workflow_dispatch: + schedule: + cron: "0 0 1 * *" jobs: deploy: From 62acba47d53e304f71202946270daf8288810137 Mon Sep 17 00:00:00 2001 From: Erik Schamper <1254028+Schamper@users.noreply.github.com> Date: Wed, 21 May 2025 14:36:42 +0000 Subject: [PATCH 4/7] Add push and schedule as event filters --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2ef0887..4554454 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,6 +27,8 @@ jobs: push: filter refFilterForPush: refs/heads/main eventFilterForPush: | + push + schedule workflow_dispatch env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From f5ad296b4ef7439574b35aa673136618cca2f21c Mon Sep 17 00:00:00 2001 From: Erik Schamper <1254028+Schamper@users.noreply.github.com> Date: Wed, 21 May 2025 17:03:09 +0200 Subject: [PATCH 5/7] Update release.yml Co-authored-by: Miauwkeru --- .github/workflows/release.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4554454..0fdc7a5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,5 +1,9 @@ name: "Release devcontainer image" on: + pull_request: + push: + branches: + - main workflow_dispatch: schedule: cron: "0 0 1 * *" From 6296604acb223743ac7763ce7665ef7f6efd6310 Mon Sep 17 00:00:00 2001 From: Erik Schamper <1254028+Schamper@users.noreply.github.com> Date: Wed, 21 May 2025 17:30:29 +0200 Subject: [PATCH 6/7] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0fdc7a5..173add9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,7 @@ on: - main workflow_dispatch: schedule: - cron: "0 0 1 * *" + - cron: "0 0 1 * *" jobs: deploy: From 2bafe5009b4c31203e846a58e4741dff1b9654c8 Mon Sep 17 00:00:00 2001 From: Erik Schamper <1254028+Schamper@users.noreply.github.com> Date: Wed, 21 May 2025 18:38:49 +0200 Subject: [PATCH 7/7] Update release.yml --- .github/workflows/release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 173add9..1cd5fbb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,7 +10,6 @@ on: jobs: deploy: - if: ${{ github.ref == 'refs/heads/main' }} runs-on: ubuntu-latest steps: - name: Checkout (GitHub)