From 9dae14d2f8da1773bc6b4a1ab41b0c5c81478387 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 28 Dec 2025 20:49:01 +0000 Subject: [PATCH 1/5] Initial plan From 469d228d582bb6fd71138769e5e6b534a4403522 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 28 Dec 2025 20:51:42 +0000 Subject: [PATCH 2/5] Add manifest.dmm and dmlist.dmr for release flow Co-authored-by: JohnAmadis <17320783+JohnAmadis@users.noreply.github.com> --- dmlist.dmr | 15 +++++++++++++++ manifest.dmm | 5 +++++ 2 files changed, 20 insertions(+) create mode 100644 dmlist.dmr create mode 100644 manifest.dmm diff --git a/dmlist.dmr b/dmlist.dmr new file mode 100644 index 0000000..4000cb4 --- /dev/null +++ b/dmlist.dmr @@ -0,0 +1,15 @@ +# DMOD Resource File for dmlist +# This file specifies where resources should be installed +# Note: dmlist is a built-in module, so no .dmf file is distributed + +# === Header Files === +# Include directory with dmlist.h header +inc=./include => ${destination}/${module}/include + +# === Documentation === +# README file +readme=./README.md => ${destination}/${module}/README.md + +# === License === +# License file +license=./LICENSE => ${destination}/${module}/LICENSE diff --git a/manifest.dmm b/manifest.dmm new file mode 100644 index 0000000..3fd8df1 --- /dev/null +++ b/manifest.dmm @@ -0,0 +1,5 @@ +# Include dynamically generated versions list from latest release +$include https://github.com/choco-technologies/dmlist/releases/download/vlatest/versions.dmm + +# Module entries with version placeholder - will be expanded by $version-available +dmlist https://github.com/choco-technologies/dmlist/releases/download/v/dmlist-v-.zip From b4a6c31f7a4fa9d9c6374a0048163642153bd364 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 28 Dec 2025 20:56:43 +0000 Subject: [PATCH 3/5] Add CI release workflow for dmlist module Co-authored-by: JohnAmadis <17320783+JohnAmadis@users.noreply.github.com> --- .github/workflows/release.yml | 233 ++++++++++++++++++++++++++++++++++ 1 file changed, 233 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..7caced4 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,233 @@ +name: Release + +on: + release: + types: [created] + +jobs: + build-release: + name: Build Release Package + runs-on: ubuntu-latest + permissions: + contents: write + + container: + image: chocotechnologies/dmod:1.0.4 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Extract version from tag + id: get_version + run: | + # Extract version from tag (e.g., v1.2 -> 1.2) + VERSION="${{ github.event.release.tag_name }}" + VERSION="${VERSION#v}" # Remove 'v' prefix if present + echo "version=$VERSION" >> $GITHUB_OUTPUT + echo "Extracted version: $VERSION" + + - name: Prepare release package + run: | + set -e + mkdir -p release_package + + # Copy dmlist resource file + cp dmlist.dmr release_package/ + + # Copy header files + mkdir -p release_package/include + cp include/dmlist.h release_package/include/ + + # Copy documentation and license + cp README.md release_package/ + cp LICENSE release_package/ + + # Create release notes file from GitHub release + echo "${{ github.event.release.body }}" > release_package/RELEASE_NOTES.txt + + echo "Package contents:" + ls -la release_package/ + ls -la release_package/include/ + + - name: Create release archive + run: | + cd release_package + zip -r ../dmlist-${{ github.event.release.tag_name }}-arch_name.zip . + cd .. + echo "Created archive:" + ls -lh dmlist-*.zip + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: release-package + path: dmlist-${{ github.event.release.tag_name }}-*.zip + retention-days: 1 + + generate-versions-manifest: + name: Generate versions.dmm + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch all history to get all tags + + - name: Generate versions.dmm + run: | + set -e + echo "# List of available versions for dmlist module" > versions.dmm + echo "# Generated automatically by CI" >> versions.dmm + echo "" >> versions.dmm + + # Get all version tags (starting with 'v') and extract version numbers + VERSIONS=$(git tag -l 'v*' | sed 's/^v//' | sort -V | tr '\n' ' ' | sed 's/ $//') + + # Remove vlatest from the list if present + VERSIONS=$(echo $VERSIONS | sed 's/\blatest\b//g' | xargs) + + if [ -z "$VERSIONS" ]; then + echo "Warning: No version tags found" + VERSIONS="${{ github.event.release.tag_name }}" + VERSIONS="${VERSIONS#v}" + fi + + echo "Found versions: $VERSIONS" + + # Add $version-available directive for dmlist module + echo "\$version-available dmlist $VERSIONS" >> versions.dmm + + echo "Generated versions.dmm:" + cat versions.dmm + + - name: Upload versions.dmm as artifact + uses: actions/upload-artifact@v4 + with: + name: versions-manifest + path: | + versions.dmm + manifest.dmm + retention-days: 1 + + + upload-release-assets: + name: Upload Release Assets + needs: [build-release, generate-versions-manifest] + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + path: artifacts + + - name: Display artifact structure + run: | + echo "Downloaded artifacts:" + ls -lR artifacts/ + + - name: Upload release assets to versioned tag + shell: bash + env: + GH_TOKEN: ${{ github.token }} + run: | + set -e + # Upload all release archives to the GitHub release + shopt -s nullglob + zip_files=(artifacts/release-*/*.zip) + + if [ ${#zip_files[@]} -eq 0 ]; then + echo "Error: No artifacts found to upload" + exit 1 + fi + + for zip_file in "${zip_files[@]}"; do + echo "Uploading $zip_file to ${{ github.event.release.tag_name }}..." + gh release upload ${{ github.event.release.tag_name }} \ + "$zip_file" \ + --repo ${{ github.repository }} \ + --clobber + done + + # Upload versions.dmm to the versioned release + if [ -f artifacts/versions-manifest/versions.dmm ]; then + echo "Uploading versions.dmm to ${{ github.event.release.tag_name }}..." + gh release upload ${{ github.event.release.tag_name }} \ + artifacts/versions-manifest/versions.dmm \ + --repo ${{ github.repository }} \ + --clobber + fi + + # Upload manifest.dmm to the versioned release + if [ -f artifacts/versions-manifest/manifest.dmm ]; then + echo "Uploading manifest.dmm to ${{ github.event.release.tag_name }}..." + gh release upload ${{ github.event.release.tag_name }} \ + artifacts/versions-manifest/manifest.dmm \ + --repo ${{ github.repository }} \ + --clobber + fi + + echo "Successfully uploaded ${#zip_files[@]} artifact(s) to ${{ github.event.release.tag_name }}" + + - name: Create or update latest release + shell: bash + env: + GH_TOKEN: ${{ github.token }} + run: | + set -e + + # Check if vlatest release exists + if gh release view vlatest --repo ${{ github.repository }} >/dev/null 2>&1; then + echo "Release vlatest exists, deleting it..." + gh release delete vlatest --repo ${{ github.repository }} --yes + fi + + # Create new vlatest release + echo "Creating vlatest release..." + gh release create vlatest \ + --repo ${{ github.repository }} \ + --title "Latest Release (based on ${{ github.event.release.tag_name }})" \ + --notes "This release always points to the latest stable version. Currently based on ${{ github.event.release.tag_name }}." + + - name: Upload release assets to latest tag + shell: bash + env: + GH_TOKEN: ${{ github.token }} + run: | + set -e + shopt -s nullglob + zip_files=(artifacts/release-*/*.zip) + + for zip_file in "${zip_files[@]}"; do + echo "Uploading $zip_file to vlatest..." + gh release upload vlatest \ + "$zip_file" \ + --repo ${{ github.repository }} \ + --clobber + done + + # Upload versions.dmm to the latest release + if [ -f artifacts/versions-manifest/versions.dmm ]; then + echo "Uploading versions.dmm to vlatest..." + gh release upload vlatest \ + artifacts/versions-manifest/versions.dmm \ + --repo ${{ github.repository }} \ + --clobber + fi + + # Upload manifest.dmm to the latest release + if [ -f artifacts/versions-manifest/manifest.dmm ]; then + echo "Uploading manifest.dmm to vlatest..." + gh release upload vlatest \ + artifacts/versions-manifest/manifest.dmm \ + --repo ${{ github.repository }} \ + --clobber + fi + + echo "Successfully uploaded ${#zip_files[@]} artifact(s) to vlatest" From 86bd1eec059c1cddb3e1a395e2e57a9764d55442 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 28 Dec 2025 20:58:03 +0000 Subject: [PATCH 4/5] Fix release workflow: remove arch suffix for architecture-independent dmlist Co-authored-by: JohnAmadis <17320783+JohnAmadis@users.noreply.github.com> --- .github/workflows/release.yml | 9 ++++----- manifest.dmm | 3 ++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7caced4..21ea497 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -53,7 +53,8 @@ jobs: - name: Create release archive run: | cd release_package - zip -r ../dmlist-${{ github.event.release.tag_name }}-arch_name.zip . + # dmlist is architecture-independent (headers only), so no arch suffix needed + zip -r ../dmlist-${{ github.event.release.tag_name }}.zip . cd .. echo "Created archive:" ls -lh dmlist-*.zip @@ -85,10 +86,8 @@ jobs: echo "" >> versions.dmm # Get all version tags (starting with 'v') and extract version numbers - VERSIONS=$(git tag -l 'v*' | sed 's/^v//' | sort -V | tr '\n' ' ' | sed 's/ $//') - - # Remove vlatest from the list if present - VERSIONS=$(echo $VERSIONS | sed 's/\blatest\b//g' | xargs) + # Exclude vlatest tag from the list + VERSIONS=$(git tag -l 'v*' | grep -v '^vlatest$' | sed 's/^v//' | sort -V | tr '\n' ' ' | sed 's/ $//' | xargs) if [ -z "$VERSIONS" ]; then echo "Warning: No version tags found" diff --git a/manifest.dmm b/manifest.dmm index 3fd8df1..e37e9ce 100644 --- a/manifest.dmm +++ b/manifest.dmm @@ -2,4 +2,5 @@ $include https://github.com/choco-technologies/dmlist/releases/download/vlatest/versions.dmm # Module entries with version placeholder - will be expanded by $version-available -dmlist https://github.com/choco-technologies/dmlist/releases/download/v/dmlist-v-.zip +# dmlist is architecture-independent (headers only) +dmlist https://github.com/choco-technologies/dmlist/releases/download/v/dmlist-v.zip From 58bdc3932c8442606882dde7a64c72c15b76573e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 28 Dec 2025 20:59:12 +0000 Subject: [PATCH 5/5] Fix artifact paths in release workflow Co-authored-by: JohnAmadis <17320783+JohnAmadis@users.noreply.github.com> --- .github/workflows/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 21ea497..62bf8da 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -63,7 +63,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: release-package - path: dmlist-${{ github.event.release.tag_name }}-*.zip + path: dmlist-${{ github.event.release.tag_name }}.zip retention-days: 1 generate-versions-manifest: @@ -139,7 +139,7 @@ jobs: set -e # Upload all release archives to the GitHub release shopt -s nullglob - zip_files=(artifacts/release-*/*.zip) + zip_files=(artifacts/release-package/*.zip) if [ ${#zip_files[@]} -eq 0 ]; then echo "Error: No artifacts found to upload" @@ -201,7 +201,7 @@ jobs: run: | set -e shopt -s nullglob - zip_files=(artifacts/release-*/*.zip) + zip_files=(artifacts/release-package/*.zip) for zip_file in "${zip_files[@]}"; do echo "Uploading $zip_file to vlatest..."