Skip to content

Update develop.yml

Update develop.yml #88

Workflow file for this run

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 # Ensure full history is fetched for tagging
- name: Set up conda
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: default
environment-file: api/environment.yml
- name: ⎔ Setup Node
uses: actions/setup-node@v3
with:
cache: "npm"
- 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: Bump version
id: bump_version
run: |
# Bump version using npm
NEW_VERSION=$(npm version patch -m "chore(release): %s [skip ci]")
NEW_VERSION=$(echo $NEW_VERSION | tr -d 'v') # Remove the 'v' prefix
echo "NEW_VERSION=${NEW_VERSION}" >> $GITHUB_ENV
- name: Commit new version
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -am "chore: bump version to ${{ env.NEW_VERSION }}"
git tag v${{ env.NEW_VERSION }}
git push origin develop --tags
- name: Rename file
run: |
$old_name = Get-ChildItem -Path dist -Filter 'LinguifAI Setup*.exe' | Select-Object -ExpandProperty Name
$new_name = "LinguifAI Setup ${{ env.NEW_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 }}