From c4aa0d069ccf1bf2ba544c5cacfe7b7f394aab43 Mon Sep 17 00:00:00 2001 From: michasdev Date: Fri, 24 Apr 2026 22:36:01 -0300 Subject: [PATCH 1/3] test ci --- .github/workflows/core-go-ci.yml | 4 +++- .github/workflows/deploy-mildstack-dev.yml | 2 +- .github/workflows/desktop-build.yml | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/core-go-ci.yml b/.github/workflows/core-go-ci.yml index d6e13b4..10c9660 100644 --- a/.github/workflows/core-go-ci.yml +++ b/.github/workflows/core-go-ci.yml @@ -1,9 +1,11 @@ -name: Core Go CI +name: 🚀 Core Go CI on: pull_request: branches: - main + paths-ignore: + - 'apps/**' paths: - 'core/**' diff --git a/.github/workflows/deploy-mildstack-dev.yml b/.github/workflows/deploy-mildstack-dev.yml index 5b2e5b5..8286215 100644 --- a/.github/workflows/deploy-mildstack-dev.yml +++ b/.github/workflows/deploy-mildstack-dev.yml @@ -1,4 +1,4 @@ -name: Deploy mildstack.dev to GitHub Pages +name: 🌐 Deploy mildstack.dev to GitHub Pages on: push: diff --git a/.github/workflows/desktop-build.yml b/.github/workflows/desktop-build.yml index 7ac62ca..c2a9238 100644 --- a/.github/workflows/desktop-build.yml +++ b/.github/workflows/desktop-build.yml @@ -1,4 +1,4 @@ -name: Build/Release Desktop +name: 🖥️ Build/Release Desktop + CLI on: push: @@ -7,6 +7,7 @@ on: tags: - 'v*' paths: + - 'apps/core/**' - 'apps/desktop/**' - '.github/workflows/desktop-build.yml' - 'apps/desktop/electron-builder.yml' From 5ab2a76e8566ffa43b100765fe3d5cff0aa157aa Mon Sep 17 00:00:00 2001 From: michasdev Date: Fri, 24 Apr 2026 23:06:20 -0300 Subject: [PATCH 2/3] feat: new desktop-build & mildstack release workflows --- .github/workflows/core-go-ci.yml | 4 +- .github/workflows/desktop-build.yml | 95 +-------- .github/workflows/mildstack-release.yml | 249 ++++++++++++++++++++++++ 3 files changed, 259 insertions(+), 89 deletions(-) create mode 100644 .github/workflows/mildstack-release.yml diff --git a/.github/workflows/core-go-ci.yml b/.github/workflows/core-go-ci.yml index 10c9660..3a857ca 100644 --- a/.github/workflows/core-go-ci.yml +++ b/.github/workflows/core-go-ci.yml @@ -1,11 +1,9 @@ -name: 🚀 Core Go CI +name: 🛠️ Core Go CI on: pull_request: branches: - main - paths-ignore: - - 'apps/**' paths: - 'core/**' diff --git a/.github/workflows/desktop-build.yml b/.github/workflows/desktop-build.yml index c2a9238..76662cc 100644 --- a/.github/workflows/desktop-build.yml +++ b/.github/workflows/desktop-build.yml @@ -1,23 +1,19 @@ -name: 🖥️ Build/Release Desktop + CLI +name: 🛠️ Desktop CI on: - push: + pull_request: branches: - main - tags: - - 'v*' paths: - - 'apps/core/**' - 'apps/desktop/**' - '.github/workflows/desktop-build.yml' - - 'apps/desktop/electron-builder.yml' - workflow_dispatch: + - '.github/workflows/desktop-release.yml' permissions: contents: read concurrency: - group: desktop-build-${{ github.ref }} + group: desktop-ci-${{ github.event.pull_request.number }} cancel-in-progress: true jobs: @@ -33,8 +29,8 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: '1.22' - cache: false + go-version: '1.26.2' + cache: true - name: Install Node.js uses: actions/setup-node@v4 @@ -58,10 +54,10 @@ jobs: - name: Upload CLI artifacts uses: actions/upload-artifact@v4 with: - name: cli-binaries + name: ci-cli-binaries path: apps/desktop/resources/bin/ if-no-files-found: error - retention-days: 7 + retention-days: 3 build-desktop: name: Build Desktop (${{ matrix.label }}) @@ -76,29 +72,12 @@ jobs: - os: macos-latest label: macOS platform: mac - artifact_name: desktop-dist-macos - release_files: | - apps/desktop/dist/*.dmg - apps/desktop/dist/*.zip - apps/desktop/dist/*.zip.blockmap - apps/desktop/dist/latest-mac.yml - os: windows-latest label: Windows platform: win - artifact_name: desktop-dist-windows - release_files: | - apps/desktop/dist/*-setup.exe - apps/desktop/dist/*.exe.blockmap - apps/desktop/dist/latest.yml - os: ubuntu-latest label: Linux platform: linux - artifact_name: desktop-dist-linux - release_files: | - apps/desktop/dist/*.AppImage - apps/desktop/dist/*.AppImage.blockmap - apps/desktop/dist/*.deb - apps/desktop/dist/latest-linux.yml steps: - name: Check out Git repository @@ -122,7 +101,7 @@ jobs: - name: Download CLI artifacts uses: actions/download-artifact@v4 with: - name: cli-binaries + name: ci-cli-binaries path: apps/desktop/resources/bin/ - name: Make binaries executable @@ -142,59 +121,3 @@ jobs: run: npx --no-install electron-builder --${{ matrix.platform }} --publish never env: NODE_OPTIONS: '--max-old-space-size=8192' - - - name: Upload packaged release artifacts - if: startsWith(github.ref, 'refs/tags/v') - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.artifact_name }} - path: ${{ matrix.release_files }} - if-no-files-found: error - retention-days: 7 - - publish-release: - name: Publish GitHub Release - if: startsWith(github.ref, 'refs/tags/v') - needs: build-desktop - runs-on: ubuntu-latest - timeout-minutes: 15 - permissions: - contents: write - - steps: - - name: Download macOS release artifacts - uses: actions/download-artifact@v4 - with: - name: desktop-dist-macos - path: release-assets/macos - - - name: Download Windows release artifacts - uses: actions/download-artifact@v4 - with: - name: desktop-dist-windows - path: release-assets/windows - - - name: Download Linux release artifacts - uses: actions/download-artifact@v4 - with: - name: desktop-dist-linux - path: release-assets/linux - - - name: Publish curated release assets - uses: softprops/action-gh-release@v2 - with: - files: | - release-assets/macos/* - release-assets/windows/* - release-assets/linux/* - fail_on_unmatched_files: true - generate_release_notes: false - body: | - Download the asset that matches your platform: - - - macOS Apple Silicon: `*-mac-arm64.dmg` - - macOS Intel: `*-mac-x64.dmg` - - Windows x64: `*-windows-x64-setup.exe` - - Windows ARM64: `*-windows-arm64-setup.exe` - - Linux AppImage (recommended): `*-linux-x64.AppImage` or `*-linux-arm64.AppImage` - - Linux Debian/Ubuntu: `*-linux-amd64.deb` or `*-linux-arm64.deb` diff --git a/.github/workflows/mildstack-release.yml b/.github/workflows/mildstack-release.yml new file mode 100644 index 0000000..06b74be --- /dev/null +++ b/.github/workflows/mildstack-release.yml @@ -0,0 +1,249 @@ +name: 🚀 MildStack Release + +on: + push: + tags: + - 'v*' + workflow_dispatch: + inputs: + release_tag: + description: 'Release tag to use for manual release, for example v0.0.3' + required: false + type: string + publish_release: + description: 'Publish a GitHub release after the build finishes' + required: true + default: false + type: boolean + draft_release: + description: 'Create the GitHub release as draft' + required: true + default: true + type: boolean + +permissions: + contents: read + +concurrency: + group: mildstack-release-${{ github.ref_name || github.run_id }} + cancel-in-progress: true + +jobs: + build-cli: + name: Build CLI Binaries + runs-on: ubuntu-latest + timeout-minutes: 20 + + steps: + - name: Check out Git repository + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.26.2' + cache: true + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: 22.12 + cache: 'npm' + cache-dependency-path: apps/desktop/package-lock.json + + - name: Install dependencies + working-directory: apps/desktop + run: npm ci --prefer-offline + env: + npm_config_fetch_retries: 5 + npm_config_fetch_retry_mintimeout: 20000 + npm_config_fetch_retry_maxtimeout: 120000 + + - name: Build Go CLI binaries + working-directory: apps/desktop + run: npm run build:cli + + - name: Upload CLI artifacts + uses: actions/upload-artifact@v4 + with: + name: release-cli-binaries + path: apps/desktop/resources/bin/ + if-no-files-found: error + retention-days: 7 + + build-desktop: + name: Build Desktop (${{ matrix.label }}) + needs: build-cli + runs-on: ${{ matrix.os }} + timeout-minutes: 35 + + strategy: + fail-fast: false + matrix: + include: + - os: macos-latest + label: macOS + platform: mac + artifact_name: desktop-dist-macos + release_files: | + apps/desktop/dist/*.dmg + apps/desktop/dist/*.zip + apps/desktop/dist/*.zip.blockmap + apps/desktop/dist/latest-mac.yml + - os: windows-latest + label: Windows + platform: win + artifact_name: desktop-dist-windows + release_files: | + apps/desktop/dist/*-setup.exe + apps/desktop/dist/*.exe.blockmap + apps/desktop/dist/latest.yml + - os: ubuntu-latest + label: Linux + platform: linux + artifact_name: desktop-dist-linux + release_files: | + apps/desktop/dist/*.AppImage + apps/desktop/dist/*.AppImage.blockmap + apps/desktop/dist/*.deb + apps/desktop/dist/latest-linux.yml + + steps: + - name: Check out Git repository + uses: actions/checkout@v4 + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: 22.12 + cache: 'npm' + cache-dependency-path: apps/desktop/package-lock.json + + - name: Install dependencies + working-directory: apps/desktop + run: npm ci --prefer-offline + env: + npm_config_fetch_retries: 5 + npm_config_fetch_retry_mintimeout: 20000 + npm_config_fetch_retry_maxtimeout: 120000 + + - name: Download CLI artifacts + uses: actions/download-artifact@v4 + with: + name: release-cli-binaries + path: apps/desktop/resources/bin/ + + - name: Make binaries executable + if: runner.os != 'Windows' + run: find apps/desktop/resources/bin -type f -exec chmod +x {} + + + - name: Clean dist directory + shell: bash + run: rm -rf apps/desktop/dist + + - name: Sync desktop version from release tag + if: startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && inputs.release_tag != '') + shell: bash + run: | + source_tag="${GITHUB_REF_NAME}" + if [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]]; then + source_tag="${{ inputs.release_tag }}" + fi + + if [[ ! "$source_tag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+([-.][0-9A-Za-z.-]+)?$ ]]; then + echo "Invalid release tag: ${source_tag}" + exit 1 + fi + + release_version="${source_tag#v}" + npm pkg set version="$release_version" --prefix apps/desktop + + - name: Build Electron app source + working-directory: apps/desktop + run: npm run build + + - name: Build Electron app + working-directory: apps/desktop + run: npx --no-install electron-builder --${{ matrix.platform }} --publish never + env: + NODE_OPTIONS: '--max-old-space-size=8192' + + - name: Upload packaged release artifacts + if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch' + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.artifact_name }} + path: ${{ matrix.release_files }} + if-no-files-found: error + retention-days: 7 + + publish-release: + name: Publish GitHub Release + if: startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && inputs.publish_release) + needs: build-desktop + runs-on: ubuntu-latest + timeout-minutes: 15 + environment: release + permissions: + contents: write + + steps: + - name: Validate manual release tag + if: github.event_name == 'workflow_dispatch' + shell: bash + run: | + if [[ -z "${{ inputs.release_tag }}" ]]; then + echo "release_tag is required when publish_release is enabled." + exit 1 + fi + + if [[ ! "${{ inputs.release_tag }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+([-.][0-9A-Za-z.-]+)?$ ]]; then + echo "Invalid release tag: ${{ inputs.release_tag }}" + exit 1 + fi + + - name: Download macOS release artifacts + uses: actions/download-artifact@v4 + with: + name: desktop-dist-macos + path: release-assets/macos + + - name: Download Windows release artifacts + uses: actions/download-artifact@v4 + with: + name: desktop-dist-windows + path: release-assets/windows + + - name: Download Linux release artifacts + uses: actions/download-artifact@v4 + with: + name: desktop-dist-linux + path: release-assets/linux + + - name: Publish curated release assets + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ github.event_name == 'workflow_dispatch' && inputs.release_tag || github.ref_name }} + target_commitish: ${{ github.sha }} + draft: ${{ github.event_name == 'workflow_dispatch' && inputs.draft_release || false }} + files: | + release-assets/macos/* + release-assets/windows/* + release-assets/linux/* + fail_on_unmatched_files: true + generate_release_notes: false + body: | + Download the asset that matches your platform: + + - macOS Apple Silicon: `*-mac-arm64.dmg` + - macOS Intel: `*-mac-x64.dmg` + - Windows x64: `*-windows-x64-setup.exe` + - Windows ARM64: `*-windows-arm64-setup.exe` + - Linux AppImage (recommended): `*-linux-x64.AppImage` or `*-linux-arm64.AppImage` + - Linux Debian/Ubuntu: `*-linux-amd64.deb` or `*-linux-arm64.deb` + + For auto-update, keep the companion files generated alongside those installers: + + - macOS: `latest-mac.yml`, `*.zip`, `*.zip.blockmap` + - Windows: `latest.yml`, `*.exe.blockmap` + - Linux: `latest-linux.yml`, `*.AppImage.blockmap` From f7647aec48a6d0421e227094527ec33d7a22bd1f Mon Sep 17 00:00:00 2001 From: michasdev Date: Fri, 24 Apr 2026 23:07:37 -0300 Subject: [PATCH 3/3] fix: worflow path --- .github/workflows/desktop-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/desktop-build.yml b/.github/workflows/desktop-build.yml index 76662cc..f4adbc2 100644 --- a/.github/workflows/desktop-build.yml +++ b/.github/workflows/desktop-build.yml @@ -7,7 +7,7 @@ on: paths: - 'apps/desktop/**' - '.github/workflows/desktop-build.yml' - - '.github/workflows/desktop-release.yml' + - '.github/workflows/mildstack-release.yml' permissions: contents: read