Merge pull request #128 from LeComptoirDesPharmacies/main #97
This file contains 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
on: | |
push: | |
branches: | |
- 'develop' | |
name: Pre-Release App | |
jobs: | |
Package_app: | |
name: Create Pre Release | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macos-13, windows-latest] | |
include: | |
- os: macos-13 | |
path: ~/Library/Caches/pip | |
- os: windows-latest | |
path: ~\AppData\Local\pip\Cache | |
python-version: ['3.12'] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
- uses: actions/cache@v4 | |
with: | |
path: ${{ matrix.path }} | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.txt --extra-index-url https://${{ secrets.DEV_DEPLOY_GEMFURY_TOKEN }}:@pypi.fury.io/lcdp-dev/ --extra-index-url https://${{ secrets.PROD_DEPLOY_GEMFURY_TOKEN }}:@pypi.fury.io/lcdp/ | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'adopt' | |
java-version: '11' | |
- name: Prepare app | |
run: python prepare.py | |
env: | |
LCDP_ENVIRONMENT: staging | |
PROVIDER_HOST: www.lcdp.ovh | |
IS_PROVIDER_SECURE: "True" | |
SENTRY_DSN: ${{ secrets.SENTRY_DSN }} | |
- run: pip install pyinstaller | |
- name: Package project | |
run: pyinstaller app.spec --distpath ./${{ matrix.os }}-${{ github.ref_name }}-app | |
- name: Zip project | |
run: 7z a ${{ matrix.os }}-${{ github.ref_name }}-app.zip ./${{ matrix.os }}-${{ github.ref_name }}-app/* | |
- name: Upload Release | |
uses: ncipollo/release-action@v1 | |
with: | |
name: pre-release-${{ github.run_id }} | |
tag: ${{ github.run_id }}-pre | |
prerelease: true | |
commit: ${{ github.sha }} | |
artifacts: ${{ matrix.os }}-${{ github.ref_name }}-app.zip | |
token: ${{ secrets.GITHUB_TOKEN }} | |
allowUpdates: true |