Skip to content

Commit

Permalink
Add make targets and packaging for standalone exes
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonGross committed Oct 20, 2023
1 parent 850a13d commit 6588541
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/standalone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Build Standalone

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
schedule:
- cron: '0 0 * * *'

jobs:
build:

strategy:
fail-fast: false
matrix:
python-version: ['3.5', '3.6', '3.7', '3.8', '3.9', '3.10', '3.11']
os: [ubuntu-latest, macos-latest, windows-latest]
exclude:
- os: windows-latest
python-version: '3.7'
- os: windows-latest
python-version: '3.6'
- os: windows-latest
python-version: '3.5'

runs-on: ${{ matrix.os }}
concurrency:
group: ${{ github.workflow }}-${{ matrix.python-version }}-${{ matrix.os }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Update pip
run: python -m pip install --upgrade pip
- name: Install dependencies
run: python -m pip install pyinstaller
- run: make standalone
- name: Upload standalone
uses: actions/upload-artifact@v3
with:
name: standalone
path: |
dist/coq-bug-minimizer/coq-bug-minimizer
dist/coq-import-inliner/coq-import-inliner
dist/coq-require-minimizer/coq-require-minimizer
- run: dist/coq-bug-minimizer/coq-bug-minimizer -h
- run: dist/coq-import-inliner/coq-import-inliner -h
- run: dist/coq-require-minimizer/coq-require-minimizer -h

standalone-check-all:
runs-on: ubuntu-latest
needs: build
if: always()
steps:
- run: echo 'The triggering workflow passed'
if: ${{ needs.build.result == 'success' }}
- run: echo 'The triggering workflow failed' && false
if: ${{ needs.build.result != 'success' }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ develop-eggs
.installed.cfg
lib
lib64
*.spec

# Installer logs
pip-log.txt
Expand Down
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,23 @@ update-__init__:
printf "%s\n" '__all__ = [' > coq_tools/__init__.py
printf " '%s',\n" $(MAIN_MODULES) >> coq_tools/__init__.py
printf "%s\n" " ]" >> coq_tools/__init__.py

PYINSTALLER_ADD_DATA := \
--add-data coq_tools/coqtop-as-coqc.sh:coq_tools/ \
--add-data coq_tools/coqtop.bat:coq_tools/ \
#

.PHONY: standalone-coq-bug-minimizer
standalone-coq-bug-minimizer:
pyinstaller find-bug.py -n coq-bug-minimizer $(PYINSTALLER_ADD_DATA)

.PHONY: standalone-coq-require-minimizer
standalone-coq-require-minimizer:
pyinstaller minimize-requires.py -n coq-require-minimizer $(PYINSTALLER_ADD_DATA)

.PHONY: standalone-coq-import-inliner
standalone-coq-import-inliner:
pyinstaller inline-imports.py -n coq-import-inliner $(PYINSTALLER_ADD_DATA)

.PHONY: standalone
standalone: standalone-coq-bug-minimizer standalone-coq-require-minimizer standalone-coq-import-inliner

0 comments on commit 6588541

Please sign in to comment.