Skip to content

Implement retry-later mechanism #561

Implement retry-later mechanism

Implement retry-later mechanism #561

Workflow file for this run

name: Build and Release
on:
push:
pull_request:
workflow_dispatch:
permissions:
contents: write
jobs:
build-linux:
name: Build Linux
if: startsWith(github.ref, 'refs/tags/')
strategy:
matrix:
include:
- GRADLE_ARCH: amd64
APPIMAGE_ARCH: x86_64
RUNS_ON: ubuntu-24.04
JAVA_VERSION: 25
- GRADLE_ARCH: arm64
APPIMAGE_ARCH: aarch64
RUNS_ON: ubuntu-24.04-arm
JAVA_VERSION: 25
runs-on: ${{ matrix.RUNS_ON }}
env:
ARCH: ${{ matrix.APPIMAGE_ARCH }}
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK ${{ matrix.JAVA_VERSION }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.JAVA_VERSION }}
distribution: 'temurin'
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y fakeroot file binutils zsync desktop-file-utils gnupg libxkbcommon-x11-0
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
fingerprint: ${{ secrets.GPG_KEY_ID }}
- name: Install AppImageTool
run: |
wget -q "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-${{ matrix.APPIMAGE_ARCH }}.AppImage" -O appimagetool
chmod +x appimagetool
sudo mv appimagetool /usr/local/bin/
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Setup Gradle cache
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
.gradle
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Build Shaded JAR
if: matrix.GRADLE_ARCH == 'amd64'
run: ./gradlew clean build
- name: Build JPackage and AppImage Binary
run: ./gradlew jpackage createAppImage
- name: Upload AppImage artifact
uses: actions/upload-artifact@v4
with:
name: GDownloader-${{ matrix.APPIMAGE_ARCH }}-appimage
path: ./core/build/jpackage/GDownloader-*-${{ matrix.APPIMAGE_ARCH }}.AppImage
if-no-files-found: error
- name: Upload AppImage zsync artifact
uses: actions/upload-artifact@v4
with:
name: GDownloader-${{ matrix.APPIMAGE_ARCH }}-appimage-zsync
path: ./core/build/jpackage/GDownloader-*-${{ matrix.APPIMAGE_ARCH }}.AppImage.zsync
if-no-files-found: error
- name: Upload portable ZIP artifact
if: matrix.GRADLE_ARCH == 'amd64'
uses: actions/upload-artifact@v4
with:
name: gdownloader-linux-portable-${{ matrix.GRADLE_ARCH }}
path: ./core/build/jpackage/gdownloader-*-linux_portable_${{ matrix.GRADLE_ARCH }}.zip
if-no-files-found: error
- name: Upload DEB package artifact
if: matrix.GRADLE_ARCH == 'amd64'
uses: actions/upload-artifact@v4
with:
name: gdownloader-linux-deb-${{ matrix.GRADLE_ARCH }}
path: ./core/build/jpackage/gdownloader-linux_*_${{ matrix.GRADLE_ARCH }}.deb
if-no-files-found: error
- name: Upload JAR artifact
if: matrix.GRADLE_ARCH == 'amd64'
uses: actions/upload-artifact@v4
with:
name: gdownloader-java-jar
path: ./core/build/libs/gdownloader-java-*-all.jar
if-no-files-found: error
build-windows:
name: Build Windows
strategy:
matrix:
include:
- JAVA_VERSION: 25
GRADLE_ARCH: x64
if: startsWith(github.ref, 'refs/tags/')
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK ${{ matrix.JAVA_VERSION }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.JAVA_VERSION }}
distribution: 'temurin'
- name: Cache WiX Toolset installation
id: wix-cache
uses: actions/cache@v4
with:
path: |
~\.dotnet\tools
~\.wix
key: ${{ runner.os }}-wix5-${{ 'wix-5.0.2' }}
- name: Install WiX Toolset v5 if not cached
if: steps.wix-cache.outputs.cache-hit != 'true'
run: |
dotnet tool install --global wix --version 5.0.2
wix extension add -g WixToolset.UI.wixext/5.0.2
wix extension add -g WixToolset.Util.wixext/5.0.2
shell: powershell
- name: Setup Gradle cache
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
.gradle
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Build JPackage Binary
run: .\gradlew clean jpackage
- name: Upload MSI artifact
uses: actions/upload-artifact@v4
with:
name: gdownloader-windows-msi
path: .\core\build\jpackage\gdownloader-*-windows_${{ matrix.GRADLE_ARCH }}.msi
if-no-files-found: error
- name: Upload portable ZIP artifact
uses: actions/upload-artifact@v4
with:
name: gdownloader-windows-portable-${{ matrix.GRADLE_ARCH }}
path: .\core\build\jpackage\gdownloader-*-windows_portable_${{ matrix.GRADLE_ARCH }}.zip
if-no-files-found: error
build-macos:
name: Build macOS
strategy:
matrix:
include:
- JAVA_VERSION: 25
GRADLE_ARCH: arm64
if: startsWith(github.ref, 'refs/tags/')
runs-on: macos-15
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK ${{ matrix.JAVA_VERSION }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.JAVA_VERSION }}
distribution: 'temurin'
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Setup Gradle cache
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
.gradle
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Build JPackage Binary
run: ./gradlew clean jpackage
- name: Upload DMG artifact
uses: actions/upload-artifact@v4
with:
name: gdownloader-mac-${{ matrix.GRADLE_ARCH }}-dmg
path: ./core/build/jpackage/gdownloader-mac-${{ matrix.GRADLE_ARCH }}-*.dmg
if-no-files-found: error
release:
name: Create Release
if: startsWith(github.ref, 'refs/tags/')
needs: [build-linux, build-windows, build-macos]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download gdownloader artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
pattern: 'gdownloader-*'
merge-multiple: true
- name: Download GDownloader artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
pattern: 'GDownloader-*'
merge-multiple: true
- name: Generate SHA256 checksums
working-directory: artifacts
run: |
sha256sum * > SHA256
- name: Create Release
uses: softprops/action-gh-release@v2
with:
name: ${{ steps.get_tag.outputs.tag }}
tag_name: ${{ steps.get_tag.outputs.tag }}
generate_release_notes: true
files: |
artifacts/*
token: ${{ secrets.GITHUB_TOKEN }}