Skip to content

Commit

Permalink
Use powershell to post dev build on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkanovikov committed Apr 3, 2023
1 parent 3aa9c6f commit ec5e0fa
Showing 1 changed file with 32 additions and 80 deletions.
112 changes: 32 additions & 80 deletions .github/workflows/build_starc_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,86 +36,25 @@ jobs:
run: |
echo "DEV_BUILD=$(git rev-list `git rev-list --tags --no-walk --max-count=1`..HEAD --count)" >> $GITHUB_ENV
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: 5.15.2
arch: win64_msvc2019_64
target: desktop
setup-python: false

- name: Install dependencies
shell: bash
run: |
choco install openssl
- name: Configure MSVC
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64

- name: Run QMake
shell: bash
run: |
cd src
qmake starc.pro CONFIG+=release DEFINES+="DEV_BUILD=$DEV_BUILD"
- name: Build
run: |
cd src
nmake
- name: Prepare installer folder
shell: bash
run: |
cd build/windows
./make-exe_64.sh ${{env.APP_VERSION}}
- name: Sign app executables
uses: skymatic/code-sign-action@v1
with:
certificate: '${{ secrets.WINDOWS_CERTIFICATE }}'
password: '${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}'
description: 'Story Architect'
timestampUrl: 'http://timestamp.digicert.com'
folder: 'build/windows/files_64'
recursive: true

- name: Make installer
uses: joncloud/[email protected]
with:
arguments: "/V3"
script-file: "build/windows/starc_64.nsi"

- name: Sign installer
uses: skymatic/code-sign-action@v1
with:
certificate: '${{ secrets.WINDOWS_CERTIFICATE }}'
password: '${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}'
description: 'Story Architect'
timestampUrl: 'http://timestamp.digicert.com'
folder: 'build/windows'

- name: Make archive with portable version
uses: vimtor/action-zip@v1
with:
files: build/windows/files_64
dest: build/windows/starc-64.zip

- name: Collect artifacts
uses: actions/upload-artifact@v3
with:
name: windows_64 packages
path: |
build/windows/starc-setup-64.exe
build/windows/starc-64.zip
- 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'
}
Invoke-WebRequest -Uri 'https://starc.app/api/app/updates/publish' -Method Post -Form $PublishForm
$NotifyForm = @{
api_key = '$env:STARC_API_KEY'
system = 'windows64'
version = '$env:BUILD_VERSION'
}
Invoke-WebRequest -Uri 'https://starc.app/api/app/updates/notify' -Method Post -Form $NotifyForm
- name: Publish artifacts to the GitHub releases
uses: softprops/action-gh-release@v1
Expand Down Expand Up @@ -229,10 +168,23 @@ 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'
}
Invoke-WebRequest -Uri 'https://starc.app/api/app/updates/publish' -Method Post -Form $PublishForm
$NotifyForm = @{
api_key = '$env:STARC_API_KEY'
system = 'windows32'
version = '$env:BUILD_VERSION'
}
Invoke-WebRequest -Uri 'https://starc.app/api/app/updates/notify' -Method Post -Form $NotifyForm
- name: Publish artifacts to GitHub releases
uses: softprops/action-gh-release@v1
Expand Down

0 comments on commit ec5e0fa

Please sign in to comment.