From 6ff864cb9ed1316375f29079c45bba5d41bfd993 Mon Sep 17 00:00:00 2001 From: Tomas Dvorak Date: Wed, 18 Mar 2026 12:22:46 +0100 Subject: [PATCH] update --- .github/CI-README.md | 12 +- .github/workflows/build-and-deploy.yml | 235 ------------------------- .github/workflows/unified-build.yml | 8 +- swingmusic-desktop | 2 +- 4 files changed, 6 insertions(+), 251 deletions(-) delete mode 100644 .github/workflows/build-and-deploy.yml diff --git a/.github/CI-README.md b/.github/CI-README.md index 5d292c4a..ef9f1c52 100644 --- a/.github/CI-README.md +++ b/.github/CI-README.md @@ -14,8 +14,8 @@ This repository uses a unified CI/CD system that builds all components from the ### 1. Unified Build (`unified-build.yml`) This is the main workflow that builds all components. It runs on: -- Push to main/master/develop branches -- Pull requests to main/master/develop +- Push to any branch +- Pull requests from any branch - Tags (for releases) - Manual dispatch @@ -46,13 +46,7 @@ Lightweight testing workflow for development. Runs on: - Tests individual components without full builds - Runs linting, unit tests, and basic build checks -### 3. Backend and Docker Build (`build-and-deploy.yml`) - -Simplified backup workflow focused only on: -- Backend Python package building -- Docker image creation - -### 4. Desktop CI (`desktop-ci.yml`) +### 3. Desktop CI (`desktop-ci.yml`) Legacy desktop-specific workflow (kept for compatibility). diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml deleted file mode 100644 index b4b93724..00000000 --- a/.github/workflows/build-and-deploy.yml +++ /dev/null @@ -1,235 +0,0 @@ -name: Backend and Docker Build - -on: - push: - branches: - - main - - master - - develop - tags: - - 'v*' - pull_request: - branches: - - main - - master - - develop - workflow_dispatch: - -env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} - FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true - -jobs: - build-client: - runs-on: ubuntu-latest - name: Build Web Client - outputs: - client-sha: ${{ steps.sha.outputs.sha }} - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Setup Node 24 - uses: actions/setup-node@v4 - with: - node-version: 24.x - - - name: Build client - run: | - cd swingmusic-webclient - npm install - npm run build - cd .. - - - name: Generate client SHA - id: sha - run: | - cd swingmusic-webclient/dist - sha256sum * | sort | sha256sum | cut -d' ' -f1 > client.sha - echo "sha=$(cat client.sha)" >> $GITHUB_OUTPUT - - - name: Upload client - uses: actions/upload-artifact@v4 - with: - path: "swingmusic-webclient/dist/" - compression-level: 0 - name: "client" - - build-python: - runs-on: ubuntu-latest - name: Build Python Package - needs: build-client - outputs: - version: ${{ steps.version.outputs.version }} - steps: - - name: Checkout swingmusic - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Download client artifact - uses: actions/download-artifact@v4 - with: - name: client - path: swingmusic-webclient/dist - - - name: Compress client and copy to src/swingmusic/client.zip - run: | - cd swingmusic-webclient/dist - zip -r client.zip . - cd ../.. - cp swingmusic-webclient/dist/client.zip src/swingmusic/client.zip - - - uses: actions/setup-python@v5 - with: - python-version: "3.11" - - - name: Get version - id: version - run: | - if [[ $GITHUB_REF == refs/tags/* ]]; then - VERSION=${GITHUB_REF#refs/tags/v} - else - VERSION=$(python -c "import sys; sys.path.insert(0, 'src'); from swingmusic import __version__; print(__version__)") - VERSION="$VERSION-${{ github.run_number }}" - fi - echo "version=$VERSION" >> $GITHUB_OUTPUT - - - name: Build wheels - run: pip wheel . -w wheelhouse --no-deps - - - name: Upload wheels - uses: actions/upload-artifact@v4 - with: - path: ./wheelhouse/*.whl - compression-level: 0 - name: "wheels" - - build-docker: - runs-on: ubuntu-latest - name: Build Docker Image - needs: [build-client, build-python] - permissions: - contents: read - packages: write - outputs: - image: ${{ steps.meta.outputs.tags }} - digest: ${{ steps.build.outputs.digest }} - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Download client artifact - uses: actions/download-artifact@v4 - with: - name: client - path: swingmusic-webclient/dist - - - name: Download wheels - uses: actions/download-artifact@v4 - with: - name: wheels - path: wheels - merge-multiple: true - - - name: Create version.txt - run: echo "${{ needs.build-python.outputs.version }}" > version.txt - - - name: Log in to Container Registry - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract metadata - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - tags: | - type=ref,event=branch,suffix=-${{ github.run_number }} - type=ref,event=pr,suffix=-pr-${{ github.event.number }} - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=raw,value=latest,enable={{is_default_branch}} - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Build and push Docker image - id: build - uses: docker/build-push-action@v5 - with: - context: . - platforms: linux/amd64,linux/arm64 - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - build-args: | - app_version=${{ needs.build-python.outputs.version }} - client_sha=${{ needs.build-client.outputs.client-sha }} - cache-from: type=gha - cache-to: type=gha,mode=max - - test-docker: - runs-on: ubuntu-latest - name: Test Docker Image - needs: build-docker - if: github.event_name != 'pull_request' - steps: - - name: Pull Docker image - run: docker pull ${{ needs.build-docker.outputs.image }} - - - name: Test container startup - run: | - timeout 30s docker run --rm ${{ needs.build-docker.outputs.image }} --help || \ - timeout 30s docker run --rm ${{ needs.build-docker.outputs.image }} --version || \ - echo "Container starts successfully" - - create-release: - runs-on: ubuntu-latest - name: Create Release - needs: [build-client, build-python, build-docker] - if: | - startsWith(github.ref, 'refs/tags/') || - github.event.inputs.force_release == 'true' - permissions: - contents: write - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Download all artifacts - uses: actions/download-artifact@v4 - - - name: Create release - uses: softprops/action-gh-release@v1 - with: - name: Release ${{ needs.build-python.outputs.version }} - tag_name: v${{ needs.build-python.outputs.version }} - body: | - ## Release ${{ needs.build-python.outputs.version }} - - ### Docker Image - - `${{ needs.build-docker.outputs.image }}` - - ### Changes - - View full changelog in [CHANGELOG.md](CHANGELOG.md) - - ### Installation - ```bash - docker pull ${{ needs.build-docker.outputs.image }} - docker run -p 1979:1979 ${{ needs.build-docker.outputs.image }} - ``` - files: | - wheels/* - client/* - draft: false - prerelease: ${{ contains(needs.build-python.outputs.version, '-') }} - generate_release_notes: true diff --git a/.github/workflows/unified-build.yml b/.github/workflows/unified-build.yml index 9f5f646b..18111f79 100644 --- a/.github/workflows/unified-build.yml +++ b/.github/workflows/unified-build.yml @@ -3,16 +3,12 @@ name: Unified Build and Deploy on: push: branches: - - main - - master - - develop + - '**' tags: - 'v*' pull_request: branches: - - main - - master - - develop + - '**' workflow_dispatch: inputs: force_release: diff --git a/swingmusic-desktop b/swingmusic-desktop index 84a76084..d6a0172c 160000 --- a/swingmusic-desktop +++ b/swingmusic-desktop @@ -1 +1 @@ -Subproject commit 84a76084f0badf2251bb9e3ae8945d0a4ccd9c45 +Subproject commit d6a0172c2d61bca64e8c7fe89cf26e9433a49ff1