build #406
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: build | |
| 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' | |
| 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' | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 22 * * *' # Runs at 6 AM Singapore time (22:00 UTC) daily | |
| env: | |
| BUILD_PYTHON_VERSION: "3.14" | |
| BUILD_POETRY_VERSION: "2.4.1" | |
| BUILD_SETUPTOOLS_VERSION: "82.0.1" | |
| BUILD_POETRY_PLUGIN_EXPORT_VERSION: "1.10.0" | |
| PACKAGE_NAME: csv2notion_neo | |
| permissions: | |
| contents: read | |
| 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==${{ env.BUILD_SETUPTOOLS_VERSION }} | |
| - name: Set up Poetry ${{ env.BUILD_POETRY_VERSION }} | |
| uses: abatilo/actions-poetry@v3.0.2 | |
| with: | |
| poetry-version: ${{ env.BUILD_POETRY_VERSION }} | |
| poetry-plugins: poetry-plugin-export==${{ env.BUILD_POETRY_PLUGIN_EXPORT_VERSION }} | |
| - 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 }} | |
| env: | |
| POETRY_VIRTUALENVS_CREATE: false | |
| 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: Set up Poetry ${{ env.BUILD_POETRY_VERSION }} | |
| uses: abatilo/actions-poetry@v3.0.2 | |
| with: | |
| poetry-version: ${{ env.BUILD_POETRY_VERSION }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pyinstaller | |
| poetry install --no-root | |
| - name: Build with pyinstaller | |
| run: pyinstaller ${{ env.PACKAGE_NAME }}.spec |