Skip to content

Feature/automated installers #2

Feature/automated installers

Feature/automated installers #2

---
name: Build MarkAPI Installers
"on":
push:
branches: [main, develop]
paths:
- 'distribution/**'
- '.github/workflows/build-installers.yml'
pull_request:
branches: [main]
paths:
- 'distribution/**'
workflow_dispatch:
inputs:
version:
description: 'Version to build'
required: false
default: '1.0.0'
env:
APP_VERSION: ${{ github.event.inputs.version || '1.0.0' }}
jobs:
build-windows:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Inno Setup
run: |
$url = "https://files.jrsoftware.org/is/6/innosetup-6.2.2.exe"
Invoke-WebRequest -Uri $url -OutFile "innosetup.exe"
Start-Process -FilePath "innosetup.exe" `
-ArgumentList "/VERYSILENT", "/SUPPRESSMSGBOXES", "/NORESTART" `
-Wait
- name: Update version in setup script
run: |
$content = Get-Content "distribution/windows/setup.iss"
$pattern = '#define MyAppVersion ".*"'
$replacement = "#define MyAppVersion `"$env:APP_VERSION`""
$content = $content -replace $pattern, $replacement
Set-Content "distribution/windows/setup.iss" $content
shell: powershell
- name: Build Windows installer
run: |
$inno = "C:\Program Files (x86)\Inno Setup 6\ISCC.exe"
& $inno "distribution/windows/setup.iss"
shell: powershell
- name: Upload Windows installer
uses: actions/upload-artifact@v4
with:
name: markapi-windows-installer
path: distribution/windows/Output/MarkAPI-Setup-*.exe
build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential devscripts debhelper
- name: Build DEB package
run: |
cd distribution/linux
chmod +x build-deb.sh
./build-deb.sh ${{ env.APP_VERSION }}
- name: Build AppImage
run: |
cd distribution/linux
chmod +x build-appimage.sh
./build-appimage.sh ${{ env.APP_VERSION }}
- name: Upload Linux packages
uses: actions/upload-artifact@v4
with:
name: markapi-linux-packages
path: |
distribution/linux/dist/*.deb
distribution/linux/dist/*.AppImage
build-universal:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Create universal package
run: |
cd distribution/universal
mkdir -p ../../dist
tar czf "../../dist/markapi-universal-${{ env.APP_VERSION }}.tar.gz" .
zip -r "../../dist/markapi-universal-${{ env.APP_VERSION }}.zip" .
- name: Upload universal package
uses: actions/upload-artifact@v4
with:
name: markapi-universal-package
path: dist/markapi-universal-*
create-release:
needs: [build-windows, build-linux, build-universal]
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch'
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ env.APP_VERSION }}
name: MarkAPI v${{ env.APP_VERSION }}
draft: false
prerelease: false
files: |
markapi-windows-installer/*
markapi-linux-packages/*
markapi-universal-package/*
body: |
# MarkAPI v${{ env.APP_VERSION }}
Instaladores automatizados para Windows, Linux e Universal.
## Downloads
- Windows: MarkAPI-Setup-${{ env.APP_VERSION }}.exe
- Ubuntu/Debian: markapi_${{ env.APP_VERSION }}_amd64.deb
- Linux Universal: MarkAPI-${{ env.APP_VERSION }}.AppImage
- Universal: markapi-universal-${{ env.APP_VERSION }}.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}