193 lines
5.1 KiB
YAML
193 lines
5.1 KiB
YAML
name: Build Application and Make Release
|
|
|
|
on:
|
|
push:
|
|
tags: [ "*" ]
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
source:
|
|
runs-on: linux
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
- name: Pack
|
|
run: ./.ci/source.sh
|
|
- name: Upload
|
|
uses: forgejo/upload-artifact@v4
|
|
with:
|
|
name: source.zip
|
|
path: artifacts/
|
|
|
|
windows:
|
|
runs-on: windows
|
|
strategy:
|
|
matrix:
|
|
target: ["msvc"] # TODO: Add msys2
|
|
defaults:
|
|
run:
|
|
shell: ${{ (matrix.target == 'msys2' && 'msys2') || 'bash' }} {0}
|
|
env:
|
|
CCACHE_DIR: ${{ runner.workspace }}/.cache/.ccache
|
|
CCACHE_COMPILERCHECK: content
|
|
CCACHE_SLOPPINESS: time_macros
|
|
OS: windows
|
|
TARGET: ${{ matrix.target }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
fetch-depth: 0
|
|
fetch-tags: true
|
|
|
|
- name: Set up vcpkg cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
${{ github.workspace }}/build/vcpkg_installed
|
|
${{ github.workspace }}/build/externals
|
|
${{ github.workspace }}/.vcpkg
|
|
key: ${{ runner.os }}-${{ matrix.target }}-vcpkg-${{ hashFiles('**/CMakeLists.txt', '**/vcpkg.json') }}-${{ github.run_id }}
|
|
restore-keys: |
|
|
${{ runner.os }}-${{ matrix.target }}-vcpkg-
|
|
|
|
- name: Set up MSVC
|
|
uses: https://github.com/ilammy/msvc-dev-cmd@v1
|
|
if: ${{ matrix.target == 'msvc' }}
|
|
|
|
- name: Cygwin with autoconf # NEEDED FOR LIBUSB
|
|
shell: cmd
|
|
run: ./.ci/windows/cygwin.bat
|
|
|
|
- name: Configure & Build
|
|
id: cmake
|
|
shell: cmd
|
|
run: ./.ci/windows/build-bqt.bat amd64 no
|
|
|
|
- name: Package artifacts
|
|
shell: powershell
|
|
run: ./.ci/windows/package.ps1 amd64 no
|
|
|
|
- name: Upload Windows artifacts
|
|
uses: forgejo/upload-artifact@v4
|
|
with:
|
|
name: ${{ matrix.target }}.zip
|
|
path: artifacts/*
|
|
|
|
linux:
|
|
runs-on: linux
|
|
env:
|
|
CCACHE_DIR: /home/runner/.cache/ccache
|
|
CCACHE_COMPILERCHECK: content
|
|
CCACHE_SLOPPINESS: time_macros
|
|
OS: linux
|
|
TARGET: fresh
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
fetch-depth: 0
|
|
fetch-tags: true
|
|
|
|
- name: Build
|
|
run: ./.ci/linux/build.sh v3 8
|
|
|
|
- name: Package AppImage
|
|
run: ./.ci/linux/package.sh v3 &> /dev/null
|
|
|
|
- name: Upload Linux artifacts
|
|
uses: forgejo/upload-artifact@v4
|
|
with:
|
|
name: linux.zip
|
|
path: ./*.AppImage
|
|
|
|
android:
|
|
runs-on: android
|
|
|
|
env:
|
|
CCACHE_DIR: /home/runner/.cache/ccache
|
|
CCACHE_COMPILERCHECK: content
|
|
CCACHE_SLOPPINESS: time_macros
|
|
OS: android
|
|
TARGET: universal
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
fetch-depth: 0
|
|
fetch-tags: true
|
|
|
|
- name: Set tag name
|
|
run: |
|
|
if [[ "$GITHUB_REF_TYPE" == "tag" ]]; then
|
|
echo "GIT_TAG_NAME=$GITHUB_REF_NAME" >> $GITHUB_ENV
|
|
fi
|
|
echo $GIT_TAG_NAME
|
|
|
|
- name: Build
|
|
run: ANDROID_HOME=/opt/android-sdk ./.ci/android/build.sh
|
|
|
|
- name: Package Android artifacts
|
|
run: ./.ci/android/package.sh
|
|
|
|
- name: Upload Android artifacts
|
|
uses: forgejo/upload-artifact@v4
|
|
with:
|
|
name: android.zip
|
|
path: artifacts/*
|
|
|
|
create_release:
|
|
needs: [linux, windows, android]
|
|
runs-on: linux
|
|
outputs:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
submodules: 'recursive'
|
|
path: 'eden-source'
|
|
|
|
- name: Download artifacts
|
|
uses: forgejo/download-artifact@v4
|
|
with:
|
|
path: artifacts
|
|
|
|
- name: Grab and store version
|
|
run: |
|
|
cd eden-source
|
|
tag_name=$(git describe --tags --abbrev=0)
|
|
echo "VERSION=$tag_name" >> $GITHUB_ENV
|
|
echo $tag_name
|
|
|
|
- name: Package artifacts properly
|
|
shell: bash
|
|
run: |
|
|
set -ex
|
|
mv ${{ github.workspace }}/eden-source eden-${{ env.VERSION }}
|
|
cd artifacts
|
|
ls *.zip
|
|
|
|
mkdir -p dist
|
|
|
|
cp linux.zip/Eden-*.AppImage dist/Eden-Linux-${{ env.VERSION }}-amd64.AppImage
|
|
cp msvc.zip/eden-windows-msvc*.zip dist/Eden-Windows-MSVC-${{ env.VERSION }}-amd64.zip
|
|
cp android.zip/eden-android*.apk dist/Eden-Android-${{ env.VERSION }}.apk
|
|
cp android.zip/eden-android*.aab dist/Eden-Android-${{ env.VERSION }}.aab
|
|
cp source.zip/eden-unified-source*.tar.xz dist/Eden-Source-${{ env.VERSION }}.tar.xz
|
|
cp source.zip/eden-unified-source*.tar.xz.sha256sum dist/Eden-Source-${{ env.VERSION }}.tar.xz.sha256sum
|
|
|
|
- name: Create release
|
|
id: create_release
|
|
uses: actions/forgejo-release@v2.6.0
|
|
with:
|
|
direction: upload
|
|
tag: ${{ env.VERSION }}
|
|
title: Eden ${{ env.VERSION }}
|
|
release-dir: artifacts/dist/
|