Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Raymo111 committed Jun 30, 2024
1 parent 18ee1b6 commit faf56b9
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 33 deletions.
56 changes: 24 additions & 32 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,48 +21,36 @@ jobs:
python-version: [ 3.11 ]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Package for ${{ matrix.os }}
run: python dist.py -d
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1
uses: microsoft/setup-msbuild@v2
if: runner.os == 'Windows'
- name: Install WiX
run: dotnet tool install --global wix
if: runner.os == 'Windows'
- name: Build WiX on Windows
run: wix build .\nexus.wxs
if: runner.os == 'Windows'
- name: Add generated binary to artifact
uses: actions/upload-artifact@v3
- name: Add generated binaries to artifact
uses: actions/upload-artifact@v4
with:
name: nexus-build
path: |
./dist/nexus
./dist/nexus-macos
./dist/nexus.exe
./dist/nexusw.exe
./nexus.msi
if-no-files-found: error
if: always()

docs:
runs-on: ubuntu-latest
# runs-on: [self-hosted, Linux]
steps:
- uses: actions/checkout@v3
- name: Add README.md and LICENSE to artifact
uses: actions/upload-artifact@v3
with:
name: nexus-build
name: nexus-${{ matrix.os }}
path: |
dist/nexus
dist/nexus-macos
dist/nexus.exe
dist/nexusw.exe
nexus.msi
LICENSE
README.md
if-no-files-found: error
if: always()

build-test:
runs-on: ubuntu-latest
Expand All @@ -71,11 +59,16 @@ jobs:
matrix:
python-version: [ 3.11 ]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Setup and activate venv
run: |
python -m venv venv
. venv/bin/activate
echo PATH=$PATH >> $GITHUB_ENV
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -86,27 +79,26 @@ jobs:
- name: Lint with flake8
run: |
flake8 --count --show-source --statistics --max-line-length=120 \
--per-file-ignores=nexus/Freqlog/backends/__init__.py:F401 --exclude=venv
--per-file-ignores=nexus/Freqlog/backends/__init__.py:F401 \
--exclude=venv,nexus/ui,resources_rc.py
- name: Build package
run: python -m build
- name: Check and install package
run: |
twine check dist/*
pip install .
- name: Test with pytest over Xvfb
run: xvfb-run -a pytest --cov=nexus
run: xvfb-run -a venv/bin/pytest --cov=nexus

release:
needs: [ package, docs, build-test ]
needs: [ package, build-test ]
runs-on: ubuntu-latest
# runs-on: [self-hosted, Linux]
if: |
github.repository_owner == 'CharaChorder' &&
github.event_name != 'pull_request'
steps:
- uses: actions/download-artifact@v3
with:
name: nexus-build
- uses: actions/download-artifact@v4
- uses: pyTooling/Actions/releaser@r0
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion nexus.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Name="nexus"
Scope="perUserOrMachine"
UpgradeCode="C4A2AC40-2DE2-5241-594D-4F4E45585553"
Version="0.5.2">
Version="0.5.3">
<MajorUpgrade DowngradeErrorMessage="A later version of [ProductName] is already installed. Setup will now exit." />
<MediaTemplate EmbedCab="yes" />
<Icon Id="icon.ico" SourceFile="ui\images\icon.ico"/>
Expand Down

0 comments on commit faf56b9

Please sign in to comment.