Skip to content

Create release

Create release #37

# 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]
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: Set up poetry
# run: |
# pipx install poetry
# - name: Install boost for Mac
# if: runner.os == 'macOS'
# run: |
# brew update
# brew install boost
# echo "LDFLAGS=-L/opt/homebrew/Cellar/lib" >> "$GITHUB_ENV"
# echo "CPPFLAGS=-I/opt/homebrew/include" >> "$GITHUB_ENV"
- name: Install dependencies
run: |
# poetry install
python -m pip install -r requirements-mac.txt
- name: Install dependencies of macOS
if: runner.os == 'macOS'
run: |
brew update
brew install libiodbc libpq
- name: Build Windows installer
if: runner.os == 'Windows'
# run: poetry run python setup.py bdist_msi
run: python -m pip install -r requirements.txt
- name: Build installer for macos-latest
if: matrix.os == 'macos-latest'
run: |
# poetry run python setup.py bdist_dmg
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: |
# poetry run python setup.py bdist_dmg
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-1.2-macos-14.dmg ./dist/pyopenva-1.2-macos-13.dmg