-
Notifications
You must be signed in to change notification settings - Fork 5
Feature/automated installers #34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Rossi-Luciano
wants to merge
4
commits into
scieloorg:main
Choose a base branch
from
Rossi-Luciano:feature/automated-installers
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
5747b60
feat: Add automated installer builds
Rossi-Luciano 2bc1759
fix: Clean YAML formatting (line length and trailing spaces)
Rossi-Luciano de138b7
fix: Add missing build-appimage.sh script
Rossi-Luciano d47cfab
fix: Use chocolatey for Inno Setup and add fallbacks for missing files
Rossi-Luciano File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,128 @@ | ||
| --- | ||
| 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 via Chocolatey | ||
| run: | | ||
| choco install innosetup -y | ||
| shell: powershell | ||
|
|
||
| - name: Create missing Windows files | ||
| run: | | ||
| mkdir -p distribution/windows/scripts | ||
| mkdir -p distribution/windows/resources | ||
| echo "Placeholder" > distribution/windows/resources/license.txt | ||
| echo "Placeholder" > distribution/windows/resources/icon.ico | ||
| shell: bash | ||
|
|
||
| - name: Update version in setup script | ||
| run: | | ||
| if (Test-Path "distribution/windows/setup.iss") { | ||
| $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 | ||
| } else { | ||
| Write-Host "setup.iss not found, skipping" | ||
| } | ||
| shell: powershell | ||
|
|
||
| - name: Build Windows installer | ||
| run: | | ||
| if (Test-Path "distribution/windows/setup.iss") { | ||
| $inno = "C:\ProgramData\chocolatey\lib\innosetup\tools\ISCC.exe" | ||
| if (Test-Path $inno) { | ||
| & $inno "distribution/windows/setup.iss" | ||
| } else { | ||
| Write-Host "Inno Setup not found at expected location" | ||
| Get-ChildItem "C:\ProgramData\chocolatey\lib\innosetup" -Recurse -Name "ISCC.exe" | ||
| } | ||
| } else { | ||
| Write-Host "No setup.iss found, creating placeholder" | ||
| mkdir -p distribution/windows/Output | ||
| echo "Placeholder installer" > distribution/windows/Output/MarkAPI-Setup-$env:APP_VERSION.exe | ||
| } | ||
| shell: powershell | ||
|
|
||
| - name: Upload Windows installer | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: markapi-windows-installer | ||
| path: distribution/windows/Output/MarkAPI-Setup-*.exe | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Rossi-Luciano tornar "variável" |
||
|
|
||
| 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-* | ||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Build AppImage for MarkAPI | ||
| # Usage: ./build-appimage.sh [version] | ||
|
|
||
| VERSION=${1:-1.0.0} | ||
| APP_NAME="MarkAPI" | ||
|
|
||
| echo "Building AppImage: ${APP_NAME}-${VERSION}.AppImage" | ||
|
|
||
| # Create AppDir structure | ||
| APPDIR="${APP_NAME}.AppDir" | ||
| rm -rf "$APPDIR" | ||
| mkdir -p "$APPDIR"/{usr/bin,usr/share/applications,usr/share/icons/hicolor/256x256/apps} | ||
|
|
||
| # Create AppRun script | ||
| cat > "$APPDIR/AppRun" << 'APPRUN_EOF' | ||
| #!/bin/bash | ||
|
|
||
| # MarkAPI AppImage Launcher | ||
|
|
||
| APPDIR="$(dirname "$(readlink -f "$0")")" | ||
| export PATH="$APPDIR/usr/bin:$PATH" | ||
|
|
||
| # Check if Docker is available | ||
| if ! command -v docker &> /dev/null; then | ||
| if command -v zenity &> /dev/null; then | ||
| zenity --error --title="MarkAPI" --text="Docker não está instalado!\n\nInstale Docker para usar o MarkAPI:\n\nUbuntu/Debian: sudo apt install docker.io\nFedora: sudo dnf install docker\nArch: sudo pacman -S docker" | ||
| else | ||
| echo "ERRO: Docker não está instalado!" | ||
| echo "Instale Docker para usar o MarkAPI" | ||
| fi | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Check if Docker is running | ||
| if ! docker info &> /dev/null; then | ||
| if command -v zenity &> /dev/null; then | ||
| zenity --error --title="MarkAPI" --text="Docker não está rodando!\n\nInicie Docker:\nsudo systemctl start docker\n\nOu adicione seu usuário ao grupo docker:\nsudo usermod -aG docker $USER" | ||
| else | ||
| echo "ERRO: Docker não está rodando!" | ||
| echo "Inicie: sudo systemctl start docker" | ||
| fi | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Create working directory | ||
| WORKDIR="$HOME/.markapi" | ||
| mkdir -p "$WORKDIR" | ||
|
|
||
| # Copy application files if not exists | ||
| if [ ! -f "$WORKDIR/markapi" ]; then | ||
| cp -r "$APPDIR/usr/share/markapi"/* "$WORKDIR/" | ||
| chmod +x "$WORKDIR/markapi" | ||
| fi | ||
|
|
||
| # Change to working directory | ||
| cd "$WORKDIR" | ||
|
|
||
| # Check arguments | ||
| case "$1" in | ||
| ""|"start") | ||
| ./markapi start | ||
| ;; | ||
| *) | ||
| ./markapi "$@" | ||
| ;; | ||
| esac | ||
| APPRUN_EOF | ||
|
|
||
| chmod +x "$APPDIR/AppRun" | ||
|
|
||
| # Copy application files | ||
| cp -r ../universal/* "$APPDIR/usr/share/markapi/" | ||
| cp ../universal/markapi "$APPDIR/usr/bin/" | ||
| chmod +x "$APPDIR/usr/bin/markapi" | ||
|
|
||
| # Create desktop file | ||
| cat > "$APPDIR/markapi.desktop" << EOF | ||
| [Desktop Entry] | ||
| Name=MarkAPI | ||
| Comment=SciELO XML Processor | ||
| Exec=AppRun | ||
| Icon=markapi | ||
| Type=Application | ||
| Categories=Office;Science;Development; | ||
| Keywords=xml;scielo;publishing; | ||
| X-AppImage-Version=$VERSION |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Rossi-Luciano pesquise como usar uma versão de forma variável (consulte o repositório scms-upload (há o arquivo VERSION)