Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document GitHub action for CI/CD to Microsoft Store #8539

Merged
merged 16 commits into from
Apr 14, 2023
Merged
49 changes: 49 additions & 0 deletions src/deployment/windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,55 @@ so, Codemagic requires
[associating the Azure Active Directory
and Partner Center accounts][azureadassociation].

#### Github Actions CI/CD
sfshaza2 marked this conversation as resolved.
Show resolved Hide resolved

Github Actions can use the
sfshaza2 marked this conversation as resolved.
Show resolved Hide resolved
[Microsoft Dev Store CLI](https://learn.microsoft.com/windows/apps/publish/msstore-dev-cli/overview)
to package applications into an MSIX and publish them to the Microsoft Store.
The [setup-msstore-cli](https://github.com/microsoft/setup-msstore-cli)
Github Action installs the cli so that the Action can use it for packaging
sfshaza2 marked this conversation as resolved.
Show resolved Hide resolved
and publishing.

As packaging the MSIX utilizes the
sfshaza2 marked this conversation as resolved.
Show resolved Hide resolved
[`msix` pub package][msix package], the project's `pubspec.yaml`
must contain an appropriate `msix_config` node.

You must create an Azure AD directory from the Dev Center with
[global administrator permission](https://azure.microsoft.com/documentation/articles/active-directory-assign-admin-roles/).

The Github Action requires environment secrets from the partner center.
sfshaza2 marked this conversation as resolved.
Show resolved Hide resolved
`AZURE_AD_TENANT_ID`, `AZURE_AD_ClIENT_ID`, and `AZURE_AD_CLIENT_SECRET`
are visible on the Dev Center following the instructions for the
[Windows Store Publish Action](https://github.com/marketplace/actions/windows-store-publish#obtaining-your-credentials).
You also need the `SELLER_ID` secret, which can be found in the Dev Center
under Account Settings > Organization Profile > Legal Info.
sfshaza2 marked this conversation as resolved.
Show resolved Hide resolved

The application must already be present in the Microsoft Dev Center with at
loic-sharma marked this conversation as resolved.
Show resolved Hide resolved
least one complete submission, and `msstore init` must be run once within
the repository before the Action can be performed. Once complete, running
[`msstore package .`](https://learn.microsoft.com/windows/apps/publish/msstore-dev-cli/package-command)
and
[`msstore publish`](https://learn.microsoft.com/windows/apps/publish/msstore-dev-cli/publish-command)
in a Github Action will package the
application into an MSIX and upload it to a new submission on the dev center.
sfshaza2 marked this conversation as resolved.
Show resolved Hide resolved

An example Action yml file for continous deployment may be found
yaakovschectman marked this conversation as resolved.
Show resolved Hide resolved
sfshaza2 marked this conversation as resolved.
Show resolved Hide resolved
[within a dedicated repository](https://github.com/yaakovschectman/SampleFlutterMSIXGithubAction/blob/main/dart.yml).
yaakovschectman marked this conversation as resolved.
Show resolved Hide resolved
The steps necessary for MSIX publishing are excerpted below:

```
- uses: microsoft/setup-msstore-cli@v1

- name: Configure the Microsoft Store CLI
run: msstore reconfigure --tenantId ${{ secrets.AZURE_AD_TENANT_ID }} --clientId ${{ secrets.AZURE_AD_ClIENT_ID }} --clientSecret ${{ secrets.AZURE_AD_CLIENT_SECRET }} --sellerId ${{ secrets.SELLER_ID }}

- name: Create MSIX
run: msstore package .

- name: Publish MSIX to the Microsoft Store
run: msstore publish -v
```

## Updating the app's version number

For apps published to the Microsoft Store,
Expand Down