Skip to content

Merge branch 'dev' of github.com:X-R-G-B/Leviator into dev #46

Merge branch 'dev' of github.com:X-R-G-B/Leviator into dev

Merge branch 'dev' of github.com:X-R-G-B/Leviator into dev #46

Workflow file for this run

name: Release
on:
push:
branches: [main, dev]
env:
BRANCH: "main"
jobs:
release-create:
permissions: write-all
runs-on: ubuntu-latest
outputs:
release: ${{ steps.release.outputs.release_tag }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- id: release
name: Create Release
if: github.repository != 'EpitechPromo2026/B-FUN-500-TLS-5-2-glados-xavier.mitault'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [[ "${{ github.ref }}" == 'refs/heads/main' ]]; then
export GITHUB_OUTPUT=$GITHUB_OUTPUT
bash ./.github/workflows/release.sh "${{ env.BRANCH }}"
else
echo "release_tag=0.0.0" >> $GITHUB_OUTPUT
fi
release-windows:
runs-on: windows-latest
needs: [release-create]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Haskell
uses: haskell-actions/setup@v2
with:
enable-stack: true
stack-version: 'latest'
- name: Install dependencies
run: ./scripts/InstallDepsWindows.ps1
- name: Build
run: make
- name: Upload To Release
if: github.ref == 'refs/heads/main'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ needs.release-create.outputs.release }} "./lvtc/lvtc-exe.exe#lvtc-windows.exe"
gh release upload ${{ needs.release-create.outputs.release }} "./lvtrun/lvtrun-exe.exe#lvtrun-windows.exe"
- name: Upload To Artifact lvtc
if: github.ref != 'refs/heads/main'
uses: actions/upload-artifact@v3
with:
name: lvtc-windows.exe
path: ./lvtc/lvtc-exe.exe
- name: Upload To Artifact lvtrun
if: github.ref != 'refs/heads/main'
uses: actions/upload-artifact@v3
with:
name: lvtrun-windows.exe
path: ./lvtrun/lvtrun-exe.exe
release-linux:
runs-on: ubuntu-latest
needs: [release-create]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Haskell
uses: haskell-actions/setup@v2
with:
enable-stack: true
stack-version: 'latest'
- name: Install dependencies
run: sudo ./scripts/InstallDepsLinux.bash
- name: Build
run: make
- name: Rename
run: |
mv lvtc/lvtc-exe lvtc-linux
mv lvtrun/lvtrun-exe lvtrun-linux
- name: Upload To Release
if: github.ref == 'refs/heads/main'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ needs.release-create.outputs.release }} "./lvtc-linux"
gh release upload ${{ needs.release-create.outputs.release }} "./lvtrun-linux"
- name: Upload To Artifact lvtc
if: github.ref != 'refs/heads/main'
uses: actions/upload-artifact@v3
with:
name: lvtc-linux
path: ./lvtc-linux
- name: Upload To Artifact lvtrun
if: github.ref != 'refs/heads/main'
uses: actions/upload-artifact@v3
with:
name: lvtrun-linux
path: ./lvtrun-linux
release-macos:
runs-on: macos-latest
needs: [release-create]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Haskell
uses: haskell-actions/setup@v2
with:
enable-stack: true
stack-version: 'latest'
- name: Install dependencies
run: ./scripts/InstallDepsMacos.zsh
- name: Build
run: make
- name: Rename
run: |
mv lvtc/lvtc-exe lvtc-macos
mv lvtrun/lvtrun-exe lvtrun-macos
- name: Upload To Release
if: github.ref == 'refs/heads/main'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ needs.release-create.outputs.release }} "./lvtc-macos"
gh release upload ${{ needs.release-create.outputs.release }} "./lvtrun-macos"
- name: Upload To Artifact lvtc
if: github.ref != 'refs/heads/main'
uses: actions/upload-artifact@v3
with:
name: lvtc-macos
path: ./lvtc-macos
- name: Upload To Artifact lvtrun
if: github.ref != 'refs/heads/main'
uses: actions/upload-artifact@v3
with:
name: lvtrun-macos
path: ./lvtrun-macos