diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..9415bb3 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,40 @@ +name: Docker + +on: + push: + tags: ["v*"] + workflow_dispatch: + +jobs: + image: + name: Образ ${{ matrix.part }} + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + strategy: + matrix: + part: [backend, nginx] + steps: + - uses: actions/checkout@v4 + - uses: docker/setup-buildx-action@v3 + - uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + # один пакет quizlab, части API различаются тегами: backend-1.2.3 / backend, nginx-1.2.3 / nginx + - id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/edeev/quizlab + flavor: latest=false + tags: | + type=semver,pattern={{version}},prefix=${{ matrix.part }}- + type=raw,value=${{ matrix.part }} + - uses: docker/build-push-action@v6 + with: + context: lab-2/local/${{ matrix.part }} + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3f4a548..32a3406 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,15 +30,22 @@ jobs: # рантайм MSVC рядом с программой — чтобы не требовался Visual C++ Redistributable foreach ($d in "msvcp140.dll","msvcp140_1.dll","vcruntime140.dll","vcruntime140_1.dll") { Copy-Item "$env:WINDIR\System32\$d" dist/quizlab-client/ } Compress-Archive -Path dist/quizlab-client -DestinationPath quizlab-client-windows-x64.zip + - name: Установщик (Inno Setup) + run: | + choco install innosetup --no-progress -y | Out-Null + $v = if ("${{ github.ref_type }}" -eq "tag") { "${{ github.ref_name }}".TrimStart("v") } else { "0.0.0" } + & "${env:ProgramFiles(x86)}\Inno Setup 6\ISCC.exe" /Q "/DAppVersion=$v" lab-3/installer/quizlab-client.iss - uses: actions/upload-artifact@v4 with: name: windows - path: quizlab-client-windows-x64.zip + path: | + quizlab-client-windows-x64.zip + quizlab-client-setup.exe - name: Файл в релиз if: startsWith(github.ref, 'refs/tags/') env: GH_TOKEN: ${{ github.token }} - run: gh release upload "${{ github.ref_name }}" quizlab-client-windows-x64.zip --clobber + run: gh release upload "${{ github.ref_name }}" quizlab-client-windows-x64.zip quizlab-client-setup.exe --clobber linux: name: Qt-клиент для Linux (AppImage) diff --git a/lab-3/installer/quizlab-client.iss b/lab-3/installer/quizlab-client.iss new file mode 100644 index 0000000..04a59e5 --- /dev/null +++ b/lab-3/installer/quizlab-client.iss @@ -0,0 +1,40 @@ +; Установщик Qt-клиента для Windows (Inno Setup 6). Версия передаётся из CI: ISCC /DAppVersion=1.0.1 +#ifndef AppVersion + #define AppVersion "0.0.0" +#endif + +[Setup] +AppId={{6F3B2C1E-9A4D-4E7B-8C21-5D0F7A9B3E64} +AppName=Quiz Client +AppVersion={#AppVersion} +AppPublisher=Деев Егор Викторович +AppPublisherURL=https://github.com/EDeev/quizlab +DefaultDirName={autopf}\Quiz Client +DefaultGroupName=Quiz Client +UninstallDisplayIcon={app}\quizlab-client.exe +OutputDir=..\.. +OutputBaseFilename=quizlab-client-setup +Compression=lzma2 +SolidCompression=yes +WizardStyle=modern +ArchitecturesAllowed=x64compatible +ArchitecturesInstallIn64BitMode=x64compatible +PrivilegesRequiredOverridesAllowed=dialog + +[Languages] +Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl" +Name: "english"; MessagesFile: "compiler:Default.isl" + +[Tasks] +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked + +[Files] +Source: "..\..\dist\quizlab-client\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs + +[Icons] +Name: "{group}\Quiz Client"; Filename: "{app}\quizlab-client.exe" +Name: "{group}\{cm:UninstallProgram,Quiz Client}"; Filename: "{uninstallexe}" +Name: "{autodesktop}\Quiz Client"; Filename: "{app}\quizlab-client.exe"; Tasks: desktopicon + +[Run] +Filename: "{app}\quizlab-client.exe"; Description: "{cm:LaunchProgram,Quiz Client}"; Flags: nowait postinstall skipifsilent