Skip to content

[552] fix ArgumentNullException in SyncService when no recent workout… #160

[552] fix ArgumentNullException in SyncService when no recent workout…

[552] fix ArgumentNullException in SyncService when no recent workout… #160

# This workflow will:
# - Build python package for os
# - Publish latest all-in-one windows exe
name: Publish Distro Latest
on:
workflow_dispatch:
push:
branches:
- master
paths:
- 'src/**'
- 'python/**'
- 'PelotonToGarmin.sln'
- 'configuration.example.json'
- '.github/workflows/publish_distros_latest.yml'
jobs:
publish:
runs-on: 'windows-latest'
strategy:
max-parallel: 1
matrix:
dotnet: [ '6.0' ]
#os: [ 'win10-x64', 'osx-x64' ] # osx signing issue, mac wont run the executable
os: [ 'win10-x64' ]
python-version: [ 3.9.6 ]
steps:
# Publish dotnet core exe
- uses: actions/checkout@v2
- name: Setup .NET Core SDK ${{ matrix.dotnet }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet }}
- name: Clean
run: dotnet clean --configuration Release && dotnet nuget locals all --clear
- name: Restore
run: dotnet restore
- name: Prepare env
run: |
echo "BUILD_VERSION=$Env:GITHUB_RUN_NUMBER-$Env:GITHUB_RUN_ID" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
echo "RUNNER_TOOL_CACHE=$Env:RUNNER_TOOL_CACHE" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
- name: Publish ${{matrix.os}}
run: dotnet publish ${{ github.workspace }}/src/PelotonToGarminConsole/PelotonToGarminConsole.csproj --no-restore -c Release -r ${{ matrix.os }} -o ${{ github.workspace }}/dist/${{ matrix.os }} --version-suffix ${{ env.BUILD_VERSION }} --self-contained true
- name: Copy Config to Distro
run: cp ${{ github.workspace }}/configuration.example.json ${{ github.workspace }}/dist/${{ matrix.os }}/configuration.local.json
# Package all-in-one python and add to distro
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r ${{ github.workspace }}/python/requirements.txt
pip install pyinstaller
- name: Package Python - Windows
if: ${{ matrix.os == 'win10-x64' }}
working-directory: ${{ github.workspace }}/python
run: |
pyinstaller -n upload --distpath ${{ github.workspace }}/dist/${{ matrix.os }}/python/ --console --clean --onefile --noconfirm --add-data "${{ env.RUNNER_TOOL_CACHE }}/python/3.9.6/x64/lib/site-packages/cloudscraper;./cloudscraper" ${{ github.workspace }}/python/upload.py
- name: Package Python - MacOS
if: ${{ matrix.os == 'osx-x64' }}
run: |
pyinstaller -n upload --distpath ${{ github.workspace }}/dist/${{ matrix.os }}/python/ --console --clean --onefile --noconfirm --add-data "${{ env.RUNNER_TOOL_CACHE }}/python/3.9.6/x64/lib/site-packages/cloudscraper;./cloudscraper" ${{ github.workspace }}/python/upload.py
# Create Artifact
- name: Upload Artifact ${{ matrix.os }}_${{ env.BUILD_VERSION }}
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}_${{ env.BUILD_VERSION }}
path: ${{ github.workspace }}/dist/${{ matrix.os }}