Skip to content

Create release

Create release #41

# This workflow will install Python dependencies, run cx-Freeze to create an installer file, then add it as a release.
name: Create release
permissions:
contents: write
on: [workflow_dispatch]
# push:
# branches: [ "main" ]
# pull_request:
# branches: [ "main" ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
#os: [windows-latest, macos-latest, macos-13]
os: [windows-latest, macos-latest]
python-version: ["3.11"]
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
if: runner.os == 'Windows'
run: |
python -m pip install -r requirements.txt
- name: Install dependencies of macOS
if: runner.os == 'macOS'
run: |
brew update
brew install libiodbc libpq
python -m pip install -r requirements-mac.txt
- name: Build Windows installer
if: runner.os == 'Windows'
run: python setup.py bdist_msi
- name: Build installer for macos-latest
if: matrix.os == 'macos-latest'
run: |
python setup.py bdist_dmg
# pwd
# ls ./build
# mv ./build/pyopenva.dmg ./build/pyopenva-1.2-macos-14.dmg
- name: Build installer for macos-13
if: matrix.os == 'macos-13'
run: |
python setup.py bdist_dmg
pwd
ls ./build/
mv ./build/pyopenva.dmg ./build/pyopenva-1.2-macos-13.dmg
- name: Upload Windows msi
uses: actions/upload-artifact@v4
if: runner.os == 'Windows'
with:
name: pyopenva-1.2-win64.msi
path: ./dist/*.msi
- name: Upload MacOS latest dmg
uses: actions/upload-artifact@v4
if: matrix.os == 'macos-latest'
with:
# name: pyopenva-1.2-macos-14.dmg
path: ./build/*.dmg
- name: Upload MacOS 13 dmg
uses: actions/upload-artifact@v4
if: matrix.os == 'macos-13'
with:
name: pyopenva-1.2-macos-13.dmg
path: ./build/*.dmg
create_release:
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: Display structure of downloaded files
run: ls -R ./dist
- name: Create release in GitHub and uploads attachments
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create v1.2 ./dist/pyopenva-1.2-win64.msi ./dist/pyopenVA.dmg
# run: gh release create v1.2 ./dist/pyopenva-1.2-win64.msi ./dist/pyopenva-1.2-macos-14.dmg ./dist/pyopenva-1.2-macos-13.dmg