Update develop.yml #61
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: ubuntu-latest | |
steps: | |
- name: ⬇️ Checkout repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- name: Set up conda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
activate-environment: default | |
environment-file: api/environment.yml | |
- name: Set up Wine | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "14" | |
- name: Install Wine64 | |
run: sudo apt update && sudo apt install wine64 | |
- name: Install Wine32 | |
run: | | |
sudo dpkg --add-architecture i386 | |
sudo apt-get update | |
sudo apt-get install wine32 | |
- name: ⬇️ Checkout repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- name: ⎔ Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
cache: "npm" | |
- name: 🟨 Setup Python | |
uses: actions/setup-python@v3 | |
- name: 📦 Install dependencies | |
run: npm install | |
- name: 🏗️ Install pyinstaller | |
run: | | |
pip install pyinstaller==6.6.0 | |
- name: Package Flask Application | |
uses: sayyid5416/pyinstaller@v1 | |
with: | |
python_ver: '3.12.3' | |
spec: 'api/app.spec' | |
requirements: 'api/requirements.txt' | |
- name: Install dependencies | |
run: npm install | |
- name: 📦 Electron Builder | |
run: npm run electron:package:win | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Print directory tree | |
run: tree | |
- name: Get latest release number | |
id: get_latest_release | |
uses: actions/github-script@v4 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
const response = await github.repos.listReleases({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
per_page: 10 | |
}); | |
const latestPreRelease = response.data[0]; | |
const preReleaseTag = latestPreRelease.name; | |
const versionParts = preReleaseTag.replace(/^v/, '').split('.'); | |
const newVersion = `${parseInt(versionParts[0])}.${parseInt(versionParts[1])}.${parseInt(versionParts[2]) + 1}`; | |
console.log(`::set-output name=new_version::${newVersion}`); | |
- name: Rename file | |
run: mv -f dist/LinguifAI\ Setup\ 0.1.0.exe dist/LinguifAI\ Setup\ ${{ steps.get_latest_release.outputs.new_version }}.exe | |
- name: Create Release | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
./dist/LinguifAI\ Setup\ ${{ steps.get_latest_release.outputs.new_version }}.exe | |
tag_name: v${{ steps.get_latest_release.outputs.new_version }} | |
name: v${{ steps.get_latest_release.outputs.new_version }} | |
prerelease: true | |
body: | | |
Descrição do release aqui |