Skip to content

CI CD Integration

Роман Зопиров edited this page Oct 28, 2026 · 2 revisions

CI/CD Integration Recipes

OctoPublisher is designed from the ground up for continuous integration pipelines. It returns standard exit codes (0 for success or safe skip, non-zero for fatal errors) and formats clean ANSI output without problematic emojis.


GitHub Actions: Complete Microsoft Store Workflow

This production workflow downloads your packaged Windows MSIX artifact and publishes it to Microsoft Partner Center.

name: Deploy to Microsoft Store

on:
  workflow_dispatch:
  push:
    tags:
      - 'v*'

jobs:
  deploy-store:
    name: Publish to Microsoft Store
    runs-on: windows-latest

    steps:
      - name: Checkout Code
        uses: actions/checkout@v4

      - name: Install OctoPublisher
        run: |
          dotnet tool install -g OctoPublisher

      - name: Locate MSIX Package
        id: locate-pkg
        shell: pwsh
        run: |
          $pkg = Get-ChildItem -Path "./dist" -Recurse -File -Include "*.msixupload", "*.msix" | Select-Object -First 1
          if (-not $pkg) {
            Write-Error "No MSIX package found in ./dist!"
            exit 1
          }
          echo "pkg_path=$($pkg.FullName)" >> $env:GITHUB_OUTPUT

      - name: Publish via OctoPublisher
        env:
          STORE_TENANT_ID: ${{ secrets.STORE_TENANT_ID }}
          STORE_CLIENT_ID: ${{ secrets.STORE_CLIENT_ID }}
          STORE_CLIENT_SECRET: ${{ secrets.STORE_CLIENT_SECRET }}
          STORE_APP_ID: ${{ secrets.STORE_APP_ID }}
          SELLER_ID: ${{ secrets.SELLER_ID }}
        run: |
          octopublish mstore publish `
            --package "${{ steps.locate-pkg.outputs.pkg_path }}" `
            --notes-dir "./packaging/whatsnew"

GitHub Actions: Cross-Platform Standalone Binary (Zero-Install)

If you are running on an Ubuntu or Alpine runner without .NET SDK pre-installed:

jobs:
  deploy-store:
    runs-on: ubuntu-latest
    steps:
      - name: Download OctoPublisher Binary
        run: |
          curl -LO https://github.com/OctoCore-Dev/OctoPublisher/releases/latest/download/octopublish-linux-x64
          chmod +x octopublish-linux-x64
          sudo mv octopublish-linux-x64 /usr/local/bin/octopublish

      - name: Publish
        env:
          STORE_TENANT_ID: ${{ secrets.STORE_TENANT_ID }}
          STORE_CLIENT_ID: ${{ secrets.STORE_CLIENT_ID }}
          STORE_CLIENT_SECRET: ${{ secrets.STORE_CLIENT_SECRET }}
          STORE_APP_ID: ${{ secrets.STORE_APP_ID }}
        run: |
          octopublish mstore publish --package "./App.msix" --notes "./notes.txt"

GitLab CI Recipe

stages:
  - deploy

deploy_store:
  stage: deploy
  image: mcr.microsoft.com/dotnet/sdk:10.0
  only:
    - tags
  variables:
    STORE_TENANT_ID: $CI_STORE_TENANT_ID
    STORE_CLIENT_ID: $CI_STORE_CLIENT_ID
    STORE_CLIENT_SECRET: $CI_STORE_CLIENT_SECRET
    STORE_APP_ID: $CI_STORE_APP_ID
  before_script:
    - dotnet tool install -g OctoPublisher
    - export PATH="$PATH:$HOME/.dotnet/tools"
  script:
    - octopublish mstore publish --package "./dist/App.msix" --notes "./notes.txt"

Clone this wiki locally