diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b18c3aa..92b60f6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -108,7 +108,7 @@ jobs: run: just deps - name: Run unit tests - run: just unit-test + run: just test unit build: name: Build @@ -127,14 +127,16 @@ jobs: - name: Install dependencies run: just deps - - name: Build extension package - run: just package + - name: Build and inspect extension packages + run: just package check - - name: Upload extension zip + - name: Upload extension zips uses: actions/upload-artifact@v7 with: name: extension-zip - path: dist/target/aurora-shell@luminusos.github.io.shell-extension.zip + path: | + dist/target/aurora-shell@luminusos.github.io.shell-extension.zip + dist/target/aurora-shell@luminusos.github.io.development.shell-extension.zip retention-days: 1 integration-tests: @@ -190,3 +192,6 @@ jobs: "$XDG_SESSION_ID" seat0 "$(id -u)" "$(id -un)" true bash scripts/run-shell-tests.sh \ dist/target/aurora-shell@luminusos.github.io.shell-extension.zip + AURORA_DEVTOOLS=1 bash scripts/run-shell-tests.sh \ + dist/target/aurora-shell@luminusos.github.io.development.shell-extension.zip \ + tests/shell/auroraDevTool.js diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index 3426433..e63618c 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -116,7 +116,9 @@ jobs: tag_name: ${{ needs.nightly-state.outputs.tag_name }} target_commitish: ${{ needs.nightly-state.outputs.head_sha }} name: ${{ needs.nightly-state.outputs.release_name }} - files: dist/target/aurora-shell@luminusos.github.io.shell-extension.zip + files: | + dist/target/aurora-shell@luminusos.github.io.shell-extension.zip + dist/target/aurora-shell@luminusos.github.io.development.shell-extension.zip generate_release_notes: true previous_tag: ${{ steps.stable_release.outputs.tag }} prerelease: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c636a88..f818d68 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -89,7 +89,9 @@ jobs: tag_name: ${{ needs.state.outputs.tag_name }} target_commitish: ${{ needs.state.outputs.head_sha }} name: ${{ needs.state.outputs.tag_name }} - files: dist/target/aurora-shell@luminusos.github.io.shell-extension.zip + files: | + dist/target/aurora-shell@luminusos.github.io.shell-extension.zip + dist/target/aurora-shell@luminusos.github.io.development.shell-extension.zip generate_release_notes: true prerelease: ${{ github.event_name == 'workflow_dispatch' }} diff --git a/.just/package.just b/.just/package.just new file mode 100644 index 0000000..fcaa32e --- /dev/null +++ b/.just/package.just @@ -0,0 +1,78 @@ +uuid := "aurora-shell@luminusos.github.io" + +# Build the production ZIP. +default: production + +# Build the production ZIP. +production: _build _production + +# Build the DevTool-enabled ZIP. +development: _build _development + +# Build and inspect both ZIPs. +[no-cd] +check: _build _production _development + yarn tsx scripts/check-packages.ts + +[no-cd] +_build: + just build + +[no-cd] +_production: + #!/usr/bin/env bash + set -e + mkdir -p dist/target + cd dist + + extra_sources=() + while IFS= read -r source; do + case "$source" in + dev|extension.dev.js|extension.js|metadata.json|schemas|target) continue ;; + esac + extra_sources+=("--extra-source=$source") + done < <(find . -mindepth 1 -maxdepth 1 -printf '%P\n' | sort) + + gnome-extensions pack . \ + --force \ + --out-dir=target \ + "${extra_sources[@]}" \ + --schema=schemas/org.gnome.shell.extensions.aurora-shell.gschema.xml + + echo "Production package ready." + +[no-cd] +_development: + #!/usr/bin/env bash + set -e + work="$(mktemp -d)" + stage="$work/stage" + target="$work/target" + trap 'rm -rf "$work"' EXIT + + mkdir -p "$stage" "$target" dist/target + cp -a dist/. "$stage/" + rm -rf "$stage/target" + cp "$stage/extension.dev.js" "$stage/extension.js" + cp "$stage/dev/stylesheet.css" "$stage/stylesheet.css" + cp "$stage/dev/stylesheet-light.css" "$stage/stylesheet-light.css" + cp "$stage/dev/stylesheet-dark.css" "$stage/stylesheet-dark.css" + + extra_sources=() + while IFS= read -r source; do + case "$source" in + extension.dev.js|extension.js|metadata.json|schemas|target) continue ;; + esac + extra_sources+=("--extra-source=$source") + done < <(find "$stage" -mindepth 1 -maxdepth 1 -printf '%P\n' | sort) + + gnome-extensions pack "$stage" \ + --force \ + --out-dir="$target" \ + "${extra_sources[@]}" \ + --schema="$stage/schemas/org.gnome.shell.extensions.aurora-shell.gschema.xml" + mv \ + "$target/{{ uuid }}.shell-extension.zip" \ + "dist/target/{{ uuid }}.development.shell-extension.zip" + + echo "Development package ready." diff --git a/.just/test.just b/.just/test.just new file mode 100644 index 0000000..19c7531 --- /dev/null +++ b/.just/test.just @@ -0,0 +1,37 @@ +uuid := "aurora-shell@luminusos.github.io" +production_zip := "dist/target/" + uuid + ".shell-extension.zip" +development_zip := "dist/target/" + uuid + ".development.shell-extension.zip" + +# List the available test commands. +default: + @just --list test + +# Run unit tests. +[no-cd] +unit: + yarn test:unit + +# Run unit tests with coverage. +[no-cd] +coverage: + yarn test:unit:coverage + +# Run one GNOME Shell integration test. +[no-cd] +shell script: + just package production + bash scripts/run-shell-tests.sh {{ production_zip }} {{ script }} + +# Run every production GNOME Shell integration test. +[no-cd] +all: + just package production + bash scripts/run-shell-tests.sh {{ production_zip }} + +# Run the DevTool integration test. +[no-cd] +dev: + just package development + AURORA_DEVTOOLS=1 bash scripts/run-shell-tests.sh \ + {{ development_zip }} \ + tests/shell/auroraDevTool.js diff --git a/.just/toolbox.just b/.just/toolbox.just new file mode 100644 index 0000000..91541e7 --- /dev/null +++ b/.just/toolbox.just @@ -0,0 +1,65 @@ +toolbox_name := env_var_or_default("AURORA_TOOLBOX_NAME", "aurora-shell-devel") +uuid := "aurora-shell@luminusos.github.io" +production_zip := "dist/target/" + uuid + ".shell-extension.zip" +development_zip := "dist/target/" + uuid + ".development.shell-extension.zip" + +# List the available toolbox commands. +default: + @just --list toolbox + +# Create the Fedora development toolbox. +[no-cd] +create: + #!/usr/bin/env bash + set -e + if [ -n "${AURORA_TOOLBOX_IMAGE:-}" ]; then + image="$AURORA_TOOLBOX_IMAGE" + else + image="$(bash scripts/ci-image-name.sh)" + podman build -f Containerfile -t "$image" . + fi + + echo "Creating toolbox '{{ toolbox_name }}' from '$image'..." + toolbox create --image "$image" {{ toolbox_name }} + +# Launch GNOME Shell inside the toolbox. +[no-cd] +run: + bash scripts/run-gnome-shell.sh {{ toolbox_name }} + +# Remove the development toolbox. +[no-cd] +remove: + toolbox rm --force {{ toolbox_name }} + @echo "Removed toolbox '{{ toolbox_name }}'." + +# Run a test inside the toolbox: `test