76 lines
2.1 KiB
YAML
76 lines
2.1 KiB
YAML
name: Build and Release FoxLang
|
|
|
|
on:
|
|
push:
|
|
branches: ["main"]
|
|
tags:
|
|
- "v*" # Срабатывает, когда ты пушишь тег, например v5.0.2
|
|
|
|
permissions:
|
|
contents: write # Разрешаем создавать релизы
|
|
|
|
jobs:
|
|
# --- 1. Сборка Linux ---
|
|
build-linux:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Compile with G++
|
|
run: |
|
|
# Создаем папку build, чтобы туда сложить бинарник
|
|
mkdir build
|
|
g++ -std=c++17 src/main.cpp src/Lexer.cpp src/Parser.cpp -o build/foxlang
|
|
|
|
- name: Upload Linux Artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: foxlang-linux
|
|
path: build/foxlang
|
|
|
|
# --- 2. Сборка Windows ---
|
|
build-windows:
|
|
runs-on: windows-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup MSVC
|
|
uses: ilammy/msvc-dev-cmd@v1
|
|
|
|
- name: Compile with CL
|
|
# Добавил создание папки build для порядка
|
|
run: |
|
|
mkdir build
|
|
cl /EHsc /std:c++17 src/main.cpp src/Lexer.cpp src/Parser.cpp /Febuild/foxlang.exe
|
|
|
|
- name: Upload Windows Artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: foxlang-windows
|
|
path: build/foxlang.exe
|
|
|
|
# --- 3. Публикация Релиза (Только если есть тег) ---
|
|
release:
|
|
needs: [build-linux, build-windows] # Ждем окончания сборок
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Download Linux Artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: foxlang-linux
|
|
|
|
- name: Download Windows Artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: foxlang-windows
|
|
|
|
- name: Create Release
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
files: |
|
|
foxlang
|
|
foxlang.exe
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|