Skip to content

build

build #351

Workflow file for this run

name: build
permissions:
contents: read
on:
push:
branches: [master, dev]
paths-ignore:
- 'Docs/**' # Docs folder in root of repo
- '**/*.md' # .md files anywhere in the repo
- '**/LICENSE' # LICENSE files anywhere in the repo
- '**/.gitignore' # .gitignore files anywhere in the repo
- '**/*.cursorrules' # .cursorrules files anywhere in the repo
- '**/.cursorrules' # .cursorrules files anywhere in the repo
pull_request:
branches: [master, dev]
paths-ignore:
- 'Docs/**' # Docs folder in root of repo
- '**/*.md' # .md files anywhere in the repo
- '**/LICENSE' # LICENSE files anywhere in the repo
- '**/.gitignore' # .gitignore files anywhere in the repo
- '**/.cursorrules' # .cursorrules files anywhere in the repo
workflow_dispatch:
schedule:
- cron: '0 22 * * *' # Runs at 6 AM Singapore time (22:00 UTC) daily
env:
BUILD_PYTHON_VERSION: 3.9
BUILD_POETRY_VERSION: 2.1.3
PACKAGE_NAME: csv2notion_neo
jobs:
build_python:
runs-on: ubuntu-latest
env:
POETRY_VIRTUALENVS_CREATE: false
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up Python ${{ env.BUILD_PYTHON_VERSION }}
uses: actions/setup-python@v6
with:
python-version: ${{ env.BUILD_PYTHON_VERSION }}
- name: Install setuptools
run: pip install setuptools==80.9.0
- name: Set up Poetry ${{ env.BUILD_POETRY_VERSION }}
uses: abatilo/actions-poetry@v2.0.0
with:
poetry-version: ${{ env.BUILD_POETRY_VERSION }}
- name: Install poetry-plugin-export
run: poetry self add poetry-plugin-export==1.9.0
- name: Export requirements
run: poetry export --without-hashes -f requirements.txt --output requirements.txt
- name: Build project for distribution
run: poetry build
build_binaries:
needs: build_python
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macos-latest
OS_CODE: macos
- os: ubuntu-latest
OS_CODE: linux
- os: windows-latest
OS_CODE: win
steps:
- uses: actions/checkout@v6
- name: Get version
if: matrix.os == 'macos-latest'
shell: bash
run: |
APP_VERSION=$(perl -n -e'/^__version__ = "([^"]+)"$/ && print $1' ${{ env.PACKAGE_NAME }}/version.py)
echo "APP_VERSION=$APP_VERSION" >> $GITHUB_ENV
- name: Get version
if: matrix.os != 'macos-latest'
shell: bash
run: |
APP_VERSION=$(sed -n 's/^__version__ = "\([^"]\+\)"$/\1/p' ${{ env.PACKAGE_NAME }}/version.py)
echo "APP_VERSION=$APP_VERSION" >> $GITHUB_ENV
- name: Set up Python ${{ env.BUILD_PYTHON_VERSION }}
uses: actions/setup-python@v6
env:
PIP_DISABLE_PIP_VERSION_CHECK: 1
with:
python-version: ${{ env.BUILD_PYTHON_VERSION }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller
pip install poetry
poetry install --no-root
- name: Build with pyinstaller
run: pyinstaller ${{ env.PACKAGE_NAME }}.spec