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
13 changes: 13 additions & 0 deletions .github/scripts/set-devcontainer-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ if [[ ! "${version}" =~ ^[0-9]+\.[0-9]+\.[0-9]+([.-][0-9A-Za-z.-]+)?(\+[0-9A-Za-
exit 1
fi

if [[ "${version}" == "0.0.0" ]]; then
echo "Version 0.0.0 is reserved for unreleased source manifests." >&2
exit 1
fi

mapfile -t manifest_files < <(
find features/src templates/src -type f \
\( -name 'devcontainer-feature.json' -o -name 'devcontainer-template.json' \) \
Expand All @@ -33,3 +38,11 @@ for manifest_file in "${manifest_files[@]}"; do
mv "${tmp_file}" "${manifest_file}"
echo "Updated ${manifest_file} to version ${version}"
done

for manifest_file in "${manifest_files[@]}"; do
manifest_version="$(jq -r '.version' "${manifest_file}")"
if [[ "${manifest_version}" != "${version}" ]]; then
echo "${manifest_file} has version ${manifest_version}; expected ${version}." >&2
exit 1
fi
done
18 changes: 18 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,24 @@ jobs:
base-path-to-features: "./features/src"
generate-docs: "true"

- name: Verify release versions
env:
EXPECTED_VERSION: ${{ steps.settings.outputs.version }}
run: |
set -euo pipefail

while IFS= read -r manifest_file; do
manifest_version="$(jq -r '.version' "${manifest_file}")"
if [[ "${manifest_version}" != "${EXPECTED_VERSION}" ]]; then
echo "${manifest_file} has version ${manifest_version}; expected ${EXPECTED_VERSION}." >&2
exit 1
fi
done < <(
find features/src templates/src -type f \
\( -name 'devcontainer-feature.json' -o -name 'devcontainer-template.json' \) \
| sort
)

- name: Package release source bundle
if: ${{ github.event_name == 'release' }}
id: package
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "linux-x11-forwarding",
"version": "0.1.0",
"version": "0.0.0",
"name": "Linux X11 Forwarding",
"description": "Forward a local Linux host's X11 display into a development container.",
"documentationURL": "https://github.com/althack/devcontainers/tree/main/features/src/linux-x11-forwarding",
Expand Down
2 changes: 1 addition & 1 deletion templates/src/gz/devcontainer-template.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "gz",
"version": "0.1.0",
"version": "0.0.0",
"name": "Gazebo",
"description": "Gazebo development environment.",
"documentationURL": "https://github.com/athackst/devcontainer-templates/tree/main/templates/src/gz",
Expand Down
Loading