Update develop.yml #99
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
name: CI | |
on: | |
push: | |
branches: ["develop"] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: 🏗️ Build | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
steps: | |
- name: ⬇️ Checkout repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: ⎔ Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
cache: "npm" | |
- name: Get version of the project | |
id: project-version | |
uses: 'euberdeveloper/ga-project-version@main' | |
- name: Increase patch version by 1 | |
id: increase-patch-version | |
run: | | |
$currentVersion = "${{ steps.project-version.outputs.version }}" | |
$versionArray = $currentVersion -split '\.' | |
$patchVersion = [int]$versionArray[2] + 1 | |
$newVersion = "$($versionArray[0]).$($versionArray[1]).$patchVersion" | |
Write-Output "::set-output name=patch_version::$newVersion" | |
- name: Set Git user email and name | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Cameron" | |
- name: 'change version' | |
uses: reedyuk/[email protected] | |
with: | |
version: ${{ steps.patch-version.outputs.patch_version }} | |
git-tag-version: 'true' | |
- name: Set up conda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
activate-environment: default | |
environment-file: api/environment.yml | |
- name: 🟨 Setup Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: 3.12.3 | |
- name: Install pip dependencies | |
run: pip install -r api/requirements.txt pyinstaller==6.6.0 | |
- name: Build flask exe | |
run: pyinstaller api/app.spec | |
- name: Install dependencies | |
run: npm install | |
- name: 📦 Electron Builder | |
run: npm run electron:package:win | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Get version of the project | |
id: project-version-after | |
uses: 'euberdeveloper/ga-project-version@main' | |
- name: Rename file | |
run: | | |
$old_name = Get-ChildItem -Path dist -Filter 'LinguifAI Setup*.exe' | Select-Object -ExpandProperty Name | |
$new_name = "LinguifAI Setup ${{ steps.project-version-after.outputs.version }}.exe" | |
Rename-Item -Path "dist\$old_name" -NewName $new_name | |
- name: Create Release | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
./dist/LinguifAI\ Setup\ ${{ env.NEW_VERSION }}.exe | |
tag_name: v${{ env.NEW_VERSION }} | |
name: v${{ env.NEW_VERSION }} | |
prerelease: true | |
body: ${{ github.event.head_commit.message }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |