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

Autopublish to ms store #5827

Merged
merged 6 commits into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 48 additions & 31 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jobs:
name: build (windows)
runs-on: windows-2022

outputs:
artifact_name: ${{ steps.package.outputs.artifact_name }}

steps:
- name: 🐣 Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -119,6 +122,7 @@ jobs:
ctest --output-on-failure -C ${{ env.BUILD_TYPE }} -E qmltest

- name: Package
id: package
shell: bash
run: |
cmake --build "${{ env.CMAKE_BUILD_DIR }}" --target bundle --config ${{ env.BUILD_TYPE }} -j1
Expand All @@ -127,6 +131,8 @@ jobs:
echo "ARTIFACT_PATHNAME=${ARTIFACT_PATHNAME}" >> $GITHUB_ENV
echo "ARTIFACT_NAME=qfield-${{ env.CI_PACKAGE_FILE_SUFFIX }}-windows-x64.exe" >> $GITHUB_ENV

echo "artifact_name=${ARTIFACT_NAME}" >> "$GITHUB_OUTPUT"

- name: 📑 Upload logs
uses: actions/upload-artifact@v4
if: failure()
Expand Down Expand Up @@ -181,37 +187,16 @@ jobs:
ruby-version: '3.2' # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically

# - name: 🍺 Deploy
# env:
# S3_BUCKET: qfieldapks
# S3_REGION: ch-dk-2
# S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY}}
# S3_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY}}
# run: |
# bundle exec fastlane windows upload_s3 exe:${{ env.ARTIFACT_PATHNAME }}
#
# - name: Configure Store Credentials
# uses: microsoft/store-submission@v1
# with:
# command: configure
# type: win32
# seller-id: ${{ secrets.MICROSOFT_STORE_SELLER_ID }}
# product-id: ${{ secrets.MICROSOFT_STORE_PRODUCT_ID }}
# tenant-id: ${{ secrets.AZURE_TENANT_ID }}
# client-id: ${{ secrets.AZURE_CLIENT_ID }}
# client-secret: ${{ secrets.AZURE_CLIENT_SECRET }}
#
# - name: Update Draft Submission
# uses: microsoft/store-submission@v1
# with:
# command: update
# product-update: '{"packages":[{"packageUrl":"https://cdn.contoso.us/prod/5.10.1.4420/ContosoIgniteInstallerFull.msi","languages":["en"],"architectures":["X64"],"isSilentInstall":true}]}'
#
# - name: Publish Submission
# uses: microsoft/store-submission@v1
# with:
# command: publish
#
- name: 🍺 Upload to S3
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v')
env:
S3_BUCKET: qfieldapks
S3_REGION: ch-dk-2
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY}}
S3_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY}}
run: |
bundle exec fastlane windows upload_s3 exe:${{ env.ARTIFACT_PATHNAME }}

- name: 📮 Upload debug symbols
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v') && env.ARTIFACT_NAME != null
env:
Expand All @@ -220,3 +205,35 @@ jobs:
SENTRY_PROJECT_SLUG: qfield
run: |
bundle exec fastlane run sentry_debug_files_upload path:${{ env.CMAKE_BUILD_DIR }}

deploy:
name: deploy (ms store)
runs-on: windows-2022

if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v')

needs: build

steps:
- name: Configure Store Credentials
uses: microsoft/store-submission@v1
with:
command: configure
type: win32
seller-id: ${{ secrets.MICROSOFT_STORE_SELLER_ID }}
product-id: ${{ secrets.MICROSOFT_STORE_PRODUCT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
client-id: ${{ secrets.AZURE_CLIENT_ID }}
client-secret: ${{ secrets.AZURE_CLIENT_SECRET }}

- name: Update Draft Submission
uses: microsoft/store-submission@v1
with:
command: update
# See documentation here https://learn.microsoft.com/en-us/windows/apps/publish/store-submission-api#update-current-draft-submission-metadata-api
product-update: '{"packages":[{"packageUrl":"https://sos-ch-dk-2.exo.io/qfieldapks/releases/files/${{ needs.build.outputs.artifact_name }}","languages":["en"],"architectures":["X64"],"isSilentInstall":true}]}'

- name: Publish Submission
uses: microsoft/store-submission@v1
with:
command: publish
4 changes: 1 addition & 3 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ platform :windows do
lane :upload_s3 do |options|
exe = options[:exe]

setup_ci if is_ci

aws_s3(
files: [exe],
endpoint: "https://sos-ch-dk-2.exo.io",
app_directory: "ci-builds/ios/#{ENV['CI_PACKAGE_FILE_SUFFIX']}"
app_directory: "releases"
)
end
end
Expand Down
Loading