From d6cecc8b5fb37fb039f0eed8918d94de137032be Mon Sep 17 00:00:00 2001 From: dimkanovikov Date: Mon, 3 Apr 2023 07:02:09 +0300 Subject: [PATCH] Use powershell to post dev build on Windows --- .github/workflows/build_starc_windows.yml | 42 +++++++++++++++++++---- 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_starc_windows.yml b/.github/workflows/build_starc_windows.yml index cc09f4d05..cd387a0d3 100644 --- a/.github/workflows/build_starc_windows.yml +++ b/.github/workflows/build_starc_windows.yml @@ -112,10 +112,25 @@ jobs: - name: Publish artifacts to the dev stream and notify clients if: startsWith(github.ref, 'refs/tags/') != true - shell: bash + shell: pwsh + env: + STARC_API_KEY: ${{ secrets.STARC_API_KEY }} + BUILD_VERSION: ${{env.APP_VERSION}} dev ${{env.DEV_BUILD}} run: | - curl -F "api_key=${{ secrets.STARC_API_KEY }}" -F "name_for_file=starc-setup-64.exe" -F "file_bin=@build/windows/starc-setup-64.exe" https://starc.app/api/app/updates/publish - curl -F "api_key=${{ secrets.STARC_API_KEY }}" -F "system=windows64" -F "version=${{env.APP_VERSION}} dev ${{env.DEV_BUILD}}" https://starc.app/api/app/updates/notify + $PublishForm = @{ + api_key = $env:STARC_API_KEY + name_for_file = 'starc-setup-64.exe' + #file_bin = Get-Item -Path 'build\windows\starc-setup-64.exe' + } + $PublishResult = Invoke-WebRequest -Uri 'https://starc.app/api/app/updates/publish' -Method Post -Form $PublishForm + $PublishResult + $NotifyForm = @{ + api_key = $env:STARC_API_KEY + system = 'windows64' + version = $env:BUILD_VERSION + } + $NotifyResult = Invoke-WebRequest -Uri 'https://starc.app/api/app/updates/notify' -Method Post -Form $NotifyForm + $NotifyResult - name: Publish artifacts to the GitHub releases uses: softprops/action-gh-release@v1 @@ -229,10 +244,25 @@ jobs: - name: Publish artifacts to the dev stream and notify clients if: startsWith(github.ref, 'refs/tags/') != true - shell: bash + shell: pwsh + env: + STARC_API_KEY: ${{ secrets.STARC_API_KEY }} + BUILD_VERSION: ${{env.APP_VERSION}} dev ${{env.DEV_BUILD}} run: | - curl -k -F "api_key=${{ secrets.STARC_API_KEY }}" -F "name_for_file=starc-setup-32.exe" -F "file_bin=@build/windows/starc-setup-32.exe" https://starc.app/api/app/updates/publish - curl -k -F "api_key=${{ secrets.STARC_API_KEY }}" -F "system=windows32" -F "version=${{env.APP_VERSION}} dev ${{env.DEV_BUILD}}" https://starc.app/api/app/updates/notify + $PublishForm = @{ + api_key = $env:STARC_API_KEY + name_for_file = 'starc-setup-32.exe' + #file_bin = Get-Item -Path 'build\windows\starc-setup-32.exe' + } + $PublishResult = Invoke-WebRequest -Uri 'https://starc.app/api/app/updates/publish' -Method Post -Form $PublishForm + $PublishResult + $NotifyForm = @{ + api_key = $env:STARC_API_KEY + system = 'windows32' + version = $env:BUILD_VERSION + } + $NotifyResult = Invoke-WebRequest -Uri 'https://starc.app/api/app/updates/notify' -Method Post -Form $NotifyForm + $NotifyResult - name: Publish artifacts to GitHub releases uses: softprops/action-gh-release@v1