Skip to content

Commit f16f239

Browse files
committed
chore: general updates and housekeeping
1 parent 7f5d745 commit f16f239

File tree

12 files changed

+129
-156
lines changed

12 files changed

+129
-156
lines changed

.devcontainer/devcontainer.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,5 @@
1616
}
1717
}
1818
},
19-
"postCreateCommand": {
20-
"cookieninja-cruft": "pip install cruft"
21-
},
2219
"updateContentCommand": "npm install -g @devcontainers/cli"
2320
}

.editorconfig

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,3 @@
1-
# Licensed to the Apache Software Foundation (ASF) under one
2-
# or more contributor license agreements. See the NOTICE file
3-
# distributed with this work for additional information
4-
# regarding copyright ownership. The ASF licenses this file
5-
# to you under the Apache License, Version 2.0 (the
6-
# "License"); you may not use this file except in compliance
7-
# with the License. You may obtain a copy of the License at
8-
#
9-
# http://www.apache.org/licenses/LICENSE-2.0
10-
#
11-
# Unless required by applicable law or agreed to in writing,
12-
# software distributed under the License is distributed on an
13-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14-
# KIND, either express or implied. See the License for the
15-
# specific language governing permissions and limitations
16-
# under the License.
17-
181
# editorconfig.org
192
root = true
203

@@ -30,9 +13,6 @@ insert_final_newline = true
3013
indent_style = tab
3114
indent_size = 4
3215

33-
[*.md]
34-
trim_trailing_whitespace = false
35-
3616
[Makefile]
3717
indent_style = tab
3818
indent_size = 4

.github/workflows/build.yml

Lines changed: 92 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,10 @@
1-
# Licensed to the Apache Software Foundation (ASF) under one
2-
# or more contributor license agreements. See the NOTICE file
3-
# distributed with this work for additional information
4-
# regarding copyright ownership. The ASF licenses this file
5-
# to you under the Apache License, Version 2.0 (the
6-
# "License"); you may not use this file except in compliance
7-
# with the License. You may obtain a copy of the License at
8-
#
9-
# http://www.apache.org/licenses/LICENSE-2.0
10-
#
11-
# Unless required by applicable law or agreed to in writing,
12-
# software distributed under the License is distributed on an
13-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14-
# KIND, either express or implied. See the License for the
15-
# specific language governing permissions and limitations
16-
# under the License.
17-
181
name: Build
192
on:
203
push:
214
branches:
22-
- "*"
5+
- main
6+
tags:
7+
- "v*.*.*"
238
pull_request:
249
branches:
2510
- main
@@ -29,40 +14,79 @@ on:
2914
permissions:
3015
contents: write
3116
packages: write
17+
pull-requests: read
3218
jobs:
33-
features:
34-
if: ${{ github.ref == 'refs/heads/main' }}
19+
commitlint:
20+
runs-on: ubuntu-latest
21+
env:
22+
GITHUB_TOKEN: '{{ "${{ secrets.GITHUB_TOKEN }}" }}'
23+
steps:
24+
- uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0 # fetch-depth is required
27+
28+
- uses: wagoid/commitlint-github-action@v5
29+
30+
pre-commit:
3531
runs-on: ubuntu-latest
3632
steps:
37-
- uses: actions/checkout@v3
33+
- uses: actions/checkout@v4
34+
with:
35+
fetch-depth: 0 # fetch-depth is required
3836

39-
- name: Publish
40-
uses: devcontainers/action@v1
37+
- name: Set up Go without go.mod
38+
uses: actions/setup-go@v5
39+
if: ${{ hashFiles('go.mod') == '' }}
4140
with:
42-
publish-features: "true"
43-
base-path-to-features: "./features"
44-
env:
45-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
check-latest: true
42+
43+
- name: Set up Go with go.mod
44+
uses: actions/setup-go@v5
45+
if: ${{ hashFiles('go.mod') != '' }}
46+
with:
47+
go-version-file: go.mod
48+
49+
- uses: actions/setup-python@v5
50+
with:
51+
python-version: 3.x
52+
53+
- name: Setup JS
54+
uses: actions/setup-node@v4
55+
with:
56+
node-version: lts/*
57+
58+
- name: Install dependencies
59+
run: |
60+
go install ./... || true
61+
npm ci || true
62+
63+
- uses: pre-commit/[email protected]
4664

4765
base:
4866
runs-on: ubuntu-latest
67+
needs:
68+
- commitlint
69+
- pre-commit
4970
outputs:
5071
docker_registry: ${{ steps.tags.outputs.docker_registry }}
5172
matrix: ${{ steps.tags.outputs.matrix }}
5273
tag: ${{ steps.tags.outputs.tag }}
5374
steps:
54-
- uses: actions/checkout@v3
75+
- uses: actions/checkout@v4
76+
77+
- name: Setup JS
78+
uses: actions/setup-node@v4
5579
with:
56-
fetch-depth: 0
80+
node-version: lts/*
5781

5882
- name: Set up QEMU
59-
uses: docker/setup-qemu-action@v2
83+
uses: docker/setup-qemu-action@v3
6084

6185
- name: Set up Docker Buildx
62-
uses: docker/setup-buildx-action@v2
86+
uses: docker/setup-buildx-action@v3
6387

6488
- name: Login to GitHub Container Registry
65-
uses: docker/login-action@v2
89+
uses: docker/login-action@v3
6690
with:
6791
registry: ghcr.io
6892
username: ${{ github.actor }}
@@ -72,7 +96,7 @@ jobs:
7296
id: tags
7397
run: |
7498
echo "docker_registry=ghcr.io/${GITHUB_REPOSITORY,,}" >> "$GITHUB_OUTPUT"
75-
echo "matrix={\"img\": $(jq -ncR '[inputs]' <<< $(ls -d images/*))}" >> "$GITHUB_OUTPUT"
99+
echo "matrix={\"img\": $(jq -ncR '[inputs]' <<< $(ls -d images/* | grep -v '/base'))}" >> "$GITHUB_OUTPUT"
76100
echo "tag=$(date --iso-8601)" >> "$GITHUB_OUTPUT"
77101
78102
- name: Install Dev Container CLI
@@ -88,39 +112,51 @@ jobs:
88112
--platform=linux/amd64 \
89113
--image-name=${{ steps.tags.outputs.docker_registry }}/base:${{ steps.tags.outputs.tag }} \
90114
--image-name=${{ steps.tags.outputs.docker_registry }}/base:latest \
91-
--workspace-folder=base
115+
--workspace-folder=images/base
92116
93117
if [ ${{ github.ref == 'refs/heads/main' }} = "true" ]; then
94118
echo "Pushing images"
95119
96120
docker push ${{ steps.tags.outputs.docker_registry }}/base:${{ steps.tags.outputs.tag }}
97121
docker push ${{ steps.tags.outputs.docker_registry }}/base:latest
122+
else
123+
echo "Saving base image"
124+
docker save ${{ steps.tags.outputs.docker_registry }}/base:latest -o base.tar.gz
98125
fi
99126
127+
- name: Archive Docker image
128+
uses: actions/upload-artifact@v4
129+
if: ${{ github.ref != 'refs/heads/main' }}
130+
with:
131+
name: docker-image
132+
path: base.tar.gz
133+
if-no-files-found: error
134+
retention-days: 1
135+
compression-level: 0
136+
overwrite: true
137+
100138
images:
101139
runs-on: ubuntu-latest
102140
needs:
103141
- base
104142
strategy:
105143
matrix: ${{ fromJSON(needs.base.outputs.matrix) }}
106144
steps:
107-
- uses: actions/checkout@v3
108-
with:
109-
fetch-depth: 0
145+
- uses: actions/checkout@v4
110146

111-
- name: Set up Node
112-
uses: actions/setup-node@v3
147+
- name: Setup JS
148+
uses: actions/setup-node@v4
113149
with:
114150
node-version: lts/*
115151

116152
- name: Set up QEMU
117-
uses: docker/setup-qemu-action@v2
153+
uses: docker/setup-qemu-action@v3
118154

119155
- name: Set up Docker Buildx
120-
uses: docker/setup-buildx-action@v2
156+
uses: docker/setup-buildx-action@v3
121157

122158
- name: Login to GitHub Container Registry
123-
uses: docker/login-action@v2
159+
uses: docker/login-action@v3
124160
with:
125161
registry: ghcr.io
126162
username: ${{ github.actor }}
@@ -136,8 +172,22 @@ jobs:
136172
npm install -g @devcontainers/cli
137173
devcontainer --version
138174
175+
- name: Import Docker image
176+
uses: actions/download-artifact@v4
177+
if: ${{ github.ref != 'refs/heads/main' }}
178+
with:
179+
name: docker-image
180+
139181
- name: Build Dev Container
140182
run: |
183+
if [ ${{ github.ref == 'refs/heads/main' }} = "true" ]; then
184+
echo "Pulling image from registry"
185+
docker pull ${{ needs.base.outputs.docker_registry }}/base
186+
else
187+
echo "Importing image from cache"
188+
docker import base.tar.gz ${{ needs.base.outputs.docker_registry }}/base
189+
fi
190+
141191
docker pull ${{ needs.base.outputs.docker_registry }}/${{ steps.tags.outputs.name }}:latest || true
142192
143193
devcontainer build \

.github/workflows/commitlint.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/update-documentation.yml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,3 @@
1-
# Licensed to the Apache Software Foundation (ASF) under one
2-
# or more contributor license agreements. See the NOTICE file
3-
# distributed with this work for additional information
4-
# regarding copyright ownership. The ASF licenses this file
5-
# to you under the Apache License, Version 2.0 (the
6-
# "License"); you may not use this file except in compliance
7-
# with the License. You may obtain a copy of the License at
8-
#
9-
# http://www.apache.org/licenses/LICENSE-2.0
10-
#
11-
# Unless required by applicable law or agreed to in writing,
12-
# software distributed under the License is distributed on an
13-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14-
# KIND, either express or implied. See the License for the
15-
# specific language governing permissions and limitations
16-
# under the License.
17-
181
name: "Update Documentation"
192
on:
203
push:

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,4 @@ node_modules
77
.DS_Store
88
Thumbs.db
99
.commit
10-
.devbox
1110
.envrc
12-
output

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
{
2+
"editor.formatOnSave": true,
3+
"editor.rulers": [
4+
80
5+
],
26
"yaml.schemas": {
37
"https://json.schemastore.org/github-workflow.json": [
48
".github/workflows/*.{yml,yaml}"

CODE_OF_CONDUCT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ representative at an online or offline event.
6060

6161
Instances of abusive, harassing, or otherwise unacceptable behavior may be
6262
reported to the community leaders responsible for enforcement at
63-
63+
6464
All complaints will be reviewed and investigated promptly and fairly.
6565

6666
All community leaders are obligated to respect the privacy and security of the

Makefile

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@ DOCKER_REPO ?= ghcr.io/mrsimonemms/devcontainers
1616
IMG_DIR = images
1717
PLATFORM ?= linux/amd64
1818

19+
all: build-all
20+
1921
build-all:
2022
@$(MAKE) install-devcontainers
2123

22-
@if ! command devcontainer --version; then \
23-
npm i -g @devcontainers/cli; \
24-
fi
25-
2624
@$(MAKE) build-base build-images
2725
.PHONY: build-all
2826

@@ -34,11 +32,11 @@ build:
3432
.PHONY: build
3533

3634
build-base:
37-
$(MAKE) build IMG_NAME="base" CONTEXT="base"
35+
$(MAKE) build IMG_NAME="base" CONTEXT="${IMG_DIR}/base"
3836
.PHONY: build-base
3937

4038
build-images:
41-
@for img_path in $(shell ls -d ${IMG_DIR}/*); do \
39+
@for img_path in $(shell ls -d ${IMG_DIR}/* | grep -v '/base'); do \
4240
name=$$(echo $${img_path} | sed "s/${IMG_DIR}\///"); \
4341
\
4442
$(MAKE) build IMG_NAME="$${name}" CONTEXT="$${img_path}"; \
@@ -51,11 +49,3 @@ install-devcontainers:
5149
npm i -g @devcontainers/cli; \
5250
fi
5351
.PHONY: install-devcontainers
54-
55-
cruft-update:
56-
ifeq (,$(wildcard .cruft.json))
57-
@echo "Cruft not configured"
58-
else
59-
@cruft check || cruft update --skip-apply-ask --refresh-private-variables
60-
endif
61-
.PHONY: cruft-update

0 commit comments

Comments
 (0)