From 3e7285770f7e17c08da9a7be43751debc482e4b2 Mon Sep 17 00:00:00 2001 From: Leandro Rodrigues Date: Wed, 20 May 2026 14:57:26 -0300 Subject: [PATCH] refactor(ci): restructure justfile and release workflows - Separate yarn install as explicit step, removing it as dependency from build. - Add full-install recipe for convenience (package + install). - Make install command pure (no package dependency). - Simplify all recipe to clean + full-install. - Make ci.yml a reusable workflow (add workflow_call trigger) called by release.yml. - Rewrite release.yml to run tests and publish GitHub releases from version tags. - Detect release candidates from -rc in tag and mark as pre-release. - Create maintenance branches (release/v50.x) automatically on first tag. - Delete bump-version.sh script in favor of direct git tag workflow. - Update AGENTS.md and CONTRIBUTING.md command references. - Add Branching & Release Model section documenting the new workflow. --- .github/workflows/ci.yml | 13 ++---- .github/workflows/release.yml | 65 +++++++++++++--------------- AGENTS.md | 32 ++++++++------ CONTRIBUTING.md | 79 ++++++++++++++++++++++++++++++----- justfile | 8 ++-- scripts/bump-version.sh | 61 --------------------------- 6 files changed, 124 insertions(+), 134 deletions(-) delete mode 100755 scripts/bump-version.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0d771e1..44f4878 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,8 +3,8 @@ name: CI on: push: branches: [main] - tags-ignore: ['**'] # release.yml handles tags pull_request: + workflow_call: concurrency: group: ci-${{ github.ref }} @@ -12,7 +12,7 @@ concurrency: jobs: lint: - name: Lint & type-check + name: Validate runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -55,13 +55,8 @@ jobs: - name: Install dependencies run: yarn install --immutable - - name: Install just - run: | - sudo apt-get update - sudo apt-get install -y just - - name: Run unit tests - run: just unit-test + run: yarn test:unit build: name: Build @@ -88,7 +83,7 @@ jobs: run: yarn install --immutable - name: Build & package - run: just build && just package + run: just package - name: Upload extension zip uses: actions/upload-artifact@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 029af65..e3a92a5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,42 +3,36 @@ name: Release on: push: tags: - - "v*" + - 'v[0-9]*' permissions: contents: write jobs: + ci: + uses: ./.github/workflows/ci.yml + release: - name: Build and Release + name: Create GitHub Release runs-on: ubuntu-latest - + needs: [ci] steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install system dependencies - run: | - sudo apt-get update - sudo apt-get install -y just gettext zip gnome-shell python3-gi gir1.2-glib-2.0 - - - name: Enable Corepack - run: corepack enable + - uses: actions/checkout@v4 - - name: Setup Node.js - uses: actions/setup-node@v4 + - name: Download extension zip + uses: actions/download-artifact@v4 with: - node-version: 22 - cache: yarn + name: extension-zip + path: dist/target/ - - name: Install dependencies - run: yarn install --immutable - - - name: Build - run: just build - - - name: Package - run: just package + - name: Detect pre-release + id: check + run: | + if [[ "${{ github.ref_name }}" == *"-rc"* ]]; then + echo "prerelease=true" >> $GITHUB_OUTPUT + else + echo "prerelease=false" >> $GITHUB_OUTPUT + fi - name: Create GitHub Release uses: softprops/action-gh-release@v2 @@ -46,19 +40,16 @@ jobs: name: ${{ github.ref_name }} files: dist/target/aurora-shell@luminusos.github.io.shell-extension.zip generate_release_notes: true + prerelease: ${{ steps.check.outputs.prerelease }} - - name: Create Release Branch + - name: Create maintenance branch run: | - # Extract the major version number from the tag string (e.g., v50.1 -> 50) - VERSION_NUM=${GITHUB_REF_NAME#v} - MAJOR_VERSION=$(echo "$VERSION_NUM" | cut -d. -f1) - BRANCH_NAME="release/v${MAJOR_VERSION}.x" - - # Check if the branch already exists on the remote - if git ls-remote --exit-code --heads origin "$BRANCH_NAME"; then - echo "Branch $BRANCH_NAME already exists. Skipping creation." + MAJOR=$(echo "${{ github.ref_name }}" | sed 's/^v//' | grep -oP '^\d+') + BRANCH="release/v${MAJOR}.x" + if git ls-remote --exit-code --heads origin "$BRANCH" > /dev/null 2>&1; then + echo "Branch $BRANCH already exists, skipping." else - echo "Creating and pushing new branch $BRANCH_NAME based on the current tag's HEAD" - git checkout -b "$BRANCH_NAME" - git push origin "$BRANCH_NAME" + echo "Creating branch $BRANCH" + git checkout -b "$BRANCH" + git push origin "$BRANCH" fi diff --git a/AGENTS.md b/AGENTS.md index 551b2a7..7128f6c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -25,28 +25,34 @@ Do not leave a task incomplete if either command reports errors or failures. ## Commands -- **Build:** `just build` — installs deps, compiles TypeScript and SCSS, copies metadata/schemas, compiles `.mo` files -- **Install:** `just install` — builds + packages as `.zip` + installs to GNOME Shell -- **Quick update:** `just quick` — rebuild + rsync files to extension dir (skips full install) +- **Install deps:** `just deps` — runs `yarn install`; use once or when updating packages +- **Build:** `just build` — compiles TypeScript and SCSS, copies metadata/schemas, compiles `.mo` files +- **Package:** `just package` — packs the extension as a `.zip` in `dist/target/` (depends on `build`) +- **Install:** `just install` — installs the already-packaged `.zip` to GNOME Shell (requires `just package` first) +- **Full install:** `just full-install` — packages + installs in one step +- **All:** `just all` — clean + full-install - **Uninstall:** `just uninstall` — disables and removes the extension -- **Run (host):** `just run` — build + install + launch a devkit GNOME Shell session +- **Run (host):** `just run` — launches a devkit GNOME Shell session (headless, Wayland) - **Run (toolbox):** `just toolbox run` — same as above, but inside the Fedora toolbox -- **Create toolbox:** `just toolbox create` — create the `gnome-shell-devel` Fedora toolbox +- **Create toolbox:** `just toolbox create` — create the `aurora-shell-devel` Fedora toolbox - **Remove toolbox:** `just toolbox remove` — delete the toolbox -- **Type-check:** `just validate` — runs `tsc` without emitting output -- **Lint:** `just lint` — runs ESLint -- **Unit tests:** `just unit-test` — runs unit tests via `yarn test:unit` (vitest) -- **Single integration test:** `just test