Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/actions_scripts/analyse_git_reference.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/python3

import sys

print('Number of arguments:', len(sys.argv), 'arguments.')
print('Argument List:', str(sys.argv))

fullref=sys.argv[1]
pushed_name=sys.argv[2]
jamulus_version=sys.argv[3]
release_version_name = jamulus_version

if fullref.startswith("refs/tags/"):
print('python is Tag')
is_prerelease=False
if pushed_name == "latest":
release_version_name = "latest"
release_title='Release "latest"'
else:
release_version_name = jamulus_version
release_title="Release {} ({})".format(release_version_name, pushed_name)
elif fullref.startswith("refs/heads/"):
print('python is Head')
is_prerelease=True
release_title='Pre-Release of "{}"'.format(pushed_name)
else:
print('unknown git-reference type')
release_title='Pre-Release of "{}"'.format(pushed_name)
is_prerelease=True

print("IS_PRERELEASE::{}".format(is_prerelease)) #debug output
print("RELEASE_TITLE::{}".format(release_title)) #debug output
print("::set-output name=IS_PRERELEASE::{}".format(str(is_prerelease).lower()))
print("::set-output name=RELEASE_TITLE::{}".format(release_title))
print("::set-output name=RELEASE_TAG::{}".format("releasetag/"+pushed_name))
print("::set-output name=PUSHED_NAME::{}".format(pushed_name))
print("::set-output name=JAMULUS_VERSION::{}".format(jamulus_version))
print("::set-output name=RELEASE_VERSION_NAME::{}".format(release_version_name))

15 changes: 11 additions & 4 deletions .github/actions_scripts/get_release_vars.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
#!/bin/bash

VERSION=$(cat ${1}/Jamulus.pro | grep -oP 'VERSION = \K\w[^\s\\]*')
echo "::set-output name=JAMULUS_VERSION::${VERSION}"
# get the tag which pushed this
echo "::set-output name=PUSH_TAG::${GITHUB_REF#refs/*/}"
set -e

# get version from project-file
JAMULUS_VERSION=$(cat ${1}/Jamulus.pro | grep -oP 'VERSION = \K\w[^\s\\]*')

# get the tag/branch-name which pushed this
PUSHED_NAME=${GITHUB_REF#refs/*/}

# calculate various variables
python3 ${1}/.github/actions_scripts/analyse_git_reference.py ${GITHUB_REF} ${PUSHED_NAME} ${JAMULUS_VERSION}

perl ${1}/.github/actions_scripts/getChangelog.pl ${1}/ChangeLog ${VERSION} > ${1}/autoLatestChangelog.md
187 changes: 72 additions & 115 deletions .github/workflows/autobuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,123 +3,115 @@
on:
push:
tags:
- "r*" # run this action if a tag beginning with r is created
workflow_dispatch:

- "r*"
- latest
branches:
- "*"
# - master # could be restricted to master, if all branches take too much build time
name: Publish Release
jobs:

## Creates the releases on GitHub ##
jobs:
create_release:
name: Create release
runs-on: ubuntu-latest
outputs: # The outputs the following steps give back are sent to the other job
upload_url: ${{ steps.create_release.outputs.upload_url }}
upload_latest_url: ${{ steps.create_latest_release.outputs.upload_url }}
outputs:
upload_url: ${{ steps.create_release_step.outputs.upload_url }}
version: ${{ steps.jamulus-build-vars.outputs.JAMULUS_VERSION }}
version_name: ${{ steps.jamulus-build-vars.outputs.RELEASE_VERSION_NAME }}

steps:
# Checkout code
- name: Checkout code
uses: actions/checkout@v2
- name: Get Jamulus build info # Gets Changelog and version of this build

# Set variables
# Determine releas / pre-release
- name: Get Jamulus build info
run: sh ${{ github.workspace }}/.github/actions_scripts/get_release_vars.sh ${{ github.workspace }}
id: jamulus-build-vars
- name: Remove latest tag # removes the "latest" tag from the last version

# remove tag "latest" from that release
- name: Remove release, if existing (for latest and branches)
continue-on-error: true
uses: dev-drprasad/delete-tag-and-release@v0.1.2
with:
delete_release: true
tag_name: latest # tag name to delete
delete_release: false
tag_name: ${{ steps.jamulus-build-vars.outputs.RELEASE_TAG }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Actually create the release on GitHub
- name: Prepare latest release # create a release tagged latest
id: create_latest_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: latest
release_name: Latest release ${{ steps.jamulus-build-vars.outputs.JAMULUS_VERSION }} (auto build)
body_path: ${{ github.workspace }}/autoLatestChangelog.md
draft: false
prerelease: false

- name: Prepare tag release # creates a release with the tag which triggered this action
id: create_release
# create release (empty, filled by next job)
- name: 'Create Release ${{steps.jamulus-build-vars.outputs.RELEASE_TAG}} {{steps.jamulus-build-vars.outputs.RELEASE_TITLE}}'
id: create_release_step
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.jamulus-build-vars.outputs.PUSH_TAG }}
release_name: Release ${{ steps.jamulus-build-vars.outputs.JAMULUS_VERSION }} (auto build)
tag_name: ${{ steps.jamulus-build-vars.outputs.RELEASE_TAG }}
release_name: ${{ steps.jamulus-build-vars.outputs.RELEASE_TITLE }}
body_path: ${{ github.workspace }}/autoLatestChangelog.md
prerelease: ${{ steps.jamulus-build-vars.outputs.IS_PRERELEASE }}
draft: false
prerelease: false

## Builds and uploads the binaries ##


### CANCEL ### can be used for development concerning release-creation
#- name: Cancelthrougherroe
# run: myundefinedfunction


release_assets:
name: Release assets
name: Release assets for ${{ matrix.config.config_name }}
needs: create_release
runs-on: ${{ matrix.config.os }}
runs-on: ${{ matrix.config.building_on_os }}
strategy:
matrix: # Think of this like a foreach loop. Basically runs the steps with every combination of the contents of this. More info: https://docs.github.com/en/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
config:
- os: ubuntu-18.04
- config_name: Linux (normal)
target_os: linux
building_on_os: ubuntu-18.04
asset_path: deploy/Jamulus_amd64.deb
asset_name: jamulus_${{ needs.create_release.outputs.version }}_ubuntu_amd64.deb
asset_latest_name: jamulus_latest_ubuntu_amd64.deb
asset_path_two: deploy/Jamulus_headless_amd64.deb
asset_name_two: jamulus_headless_${{ needs.create_release.outputs.version }}_ubuntu_amd64.deb
asset_latest_name_two: jamulus_headless_ubuntu_amd64.deb
- os: macos-10.15
asset_name: jamulus_${{ needs.create_release.outputs.version_name }}_ubuntu_amd64.deb
- config_name: Linux (headless)
target_os: linux
building_on_os: ubuntu-18.04
asset_path: deploy/Jamulus_headless_amd64.deb
asset_name: jamulus_headless_${{ needs.create_release.outputs.version_name }}_ubuntu_amd64.deb
- config_name: MacOS
target_os: macos
building_on_os: macos-10.15
asset_path: deploy/Jamulus-installer-mac.dmg
asset_name: jamulus_${{ needs.create_release.outputs.version }}_mac.dmg
asset_latest_name: jamulus_latest_mac.dmg
#- os: windows-latest
# asset_path: ${{ github.workspace }}\deploy\Jamulus-installer-win.exe
# asset_latest_name: jamulus_latest_win.exe
# asset_name: jamulus_${{ needs.create_release.outputs.upload_url }}_win.exe

asset_name: jamulus_${{ needs.create_release.outputs.version_name }}_mac.dmg
- config_name: Windows
target_os: windows
building_on_os: windows-latest
asset_path: deploy\Jamulus-installer-win.exe
asset_name: jamulus_${{ needs.create_release.outputs.version_name }}_win.exe
- config_name: AndroidAPK
target_os: android
building_on_os: ubuntu-18.04
asset_path: android-build/build/outputs/apk/debug/android-build-debug.apk
asset_name: jamulus_${{ needs.create_release.outputs.version_name }}_android.apk
steps:

### Setup ###

# Get the code
# Checkout code
- name: Checkout code
uses: actions/checkout@v2
# Install Qt (currently Windows only)
- name: Install Qt (64 Bit)
uses: jurplel/install-qt-action@v2
if: matrix.config.os == 'windows-latest'
with:
version: '5.15.2'
dir: '${{ github.workspace }}'
arch: 'win64_msvc2019_64'
- name: Install Qt (32 Bit)
uses: jurplel/install-qt-action@v2
if: matrix.config.os == 'windows-latest'
with:
version: '5.15.2'
dir: '${{ github.workspace }}'
arch: 'win32_msvc2019'

### Build ###

submodules: true

# Build
- name: "Build deb (Linux)"
run: sh linux/autorelease_linux.sh ${{ github.workspace }}
if: matrix.config.os == 'ubuntu-18.04'
if: matrix.config.target_os == 'linux'
- name: "Build (Windows)"
run: powershell .\windows\deploy_windows.ps1 ${{ github.workspace }}\Qt\5.15.2\; cp deploy\Jamulus*installer-win.exe deploy\Jamulus-installer-win.exe
if: matrix.config.os == 'windows-latest'
run: powershell .\windows\autorelease_windows.ps1 -sourcepath "${{ github.workspace }}"
if: matrix.config.target_os == 'windows'
- name: "Build (macOS)"
run: sh mac/autorelease_mac.sh ${{ github.workspace }}
if: matrix.config.os == 'macos-10.15'

### Upload releases ###

## Upload assets to the release which is tagged with the tag that triggered this action.
- name: Upload Release Asset 1
if: matrix.config.target_os == 'macos'
- name: "Build (Android)"
uses: ./distribute_android/ # Uses an action in the directory
if: matrix.config.target_os == 'android'

# Upload tag
- name: Upload Release Asset - Tag
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
Expand All @@ -130,38 +122,3 @@ jobs:
asset_name: ${{ matrix.config.asset_name }}
asset_content_type: application/octet-stream

# There might be two assets (at least for Debian)
- name: Upload Release Asset 2
if: matrix.config.asset_name_two != null
id: upload-release-asset-two
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ${{ matrix.config.asset_path_two }}
asset_name: ${{ matrix.config.asset_name_two }}
asset_content_type: application/octet-stream

## Upload assets latest release
- name: Upload latest Release Asset 1
id: upload-latest-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_latest_url }} # See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ${{ matrix.config.asset_path }}
asset_name: ${{ matrix.config.asset_latest_name }}
asset_content_type: application/octet-stream
- name: Upload Release Asset 2
if: matrix.config.asset_latest_name_two != null
id: upload-latest-release-asset-two
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_latest_url }}
asset_path: ${{ matrix.config.asset_path_two }}
asset_name: ${{ matrix.config.asset_latest_name_two }}
asset_content_type: application/octet-stream
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ debug/
release/
build/
deploy/
debian/
build-gui/
build-nox/
jamulus.sln
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Build Status](https://travis-ci.org/corrados/jamulus.svg?branch=master)](https://travis-ci.org/corrados/jamulus)
![CodeQL](https://github.com/corrados/jamulus/workflows/CodeQL/badge.svg)

Jamulus - Internet Jam Session Software
Jamulus - Internet Jam Session Software
=======================================
<img align="left" src="src/res/homepage/mediawikisidebarlogo.png"/>

Expand Down
82 changes: 82 additions & 0 deletions distribute_android/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
FROM ubuntu:18.04

#based on https://gitlab.com/vikingsoftware/qt5.12.4androiddocker
#LABEL "Maintainer"="Guenter Schwann"
#LABEL "version"="0.3"

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && \
apt-get install -y build-essential git zip unzip bzip2 p7zip-full wget curl chrpath libxkbcommon-x11-0 && \
# Dependencies to create Android pkg
apt-get install -y openjdk-8-jre openjdk-8-jdk openjdk-8-jdk-headless gradle && \
# Clean apt cache
apt-get clean && rm -rf /var/lib/apt/lists/*

# Add Android tools and platform tools to PATH
ENV ANDROID_HOME /opt/android/android-sdk
ENV ANDROID_SDK_ROOT /opt/android/android-sdk
ENV ANDROID_NDK_ROOT /opt/android/android-ndk

# paths for Android SDK
RUN mkdir -p ${ANDROID_SDK_ROOT}/cmdline-tools/latest/
RUN mkdir -p ${ANDROID_SDK_ROOT}/build-tools/latest/

# Install Android sdk
#https://dl.google.com/android/repository/commandlinetools-linux-6858069_latest.zip
#https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip
RUN downloadfile="downloadfile" && \
wget -q -O downloadfile https://dl.google.com/android/repository/commandlinetools-linux-6858069_latest.zip && \
unzip -q downloadfile && \
rm downloadfile && \
mv cmdline-tools/* /opt/android/android-sdk/cmdline-tools/latest/ && \
rm -r cmdline-tools

# Install Android ndk
#https://dl.google.com/android/repository/android-ndk-r19c-linux-x86_64.zip
#https://dl.google.com/android/repository/android-ndk-r21d-linux-x86_64.zip
RUN downloadfile="downloadfile" && \
wget -q -O downloadfile https://dl.google.com/android/repository/android-ndk-r21d-linux-x86_64.zip && \
unzip -q downloadfile && \
rm downloadfile && \
mv android-ndk-r21d /opt/android/android-ndk

# Add Android tools and platform tools to PATH
ENV ANDROID_HOME /opt/android/android-sdk
ENV ANDROID_SDK_ROOT /opt/android/android-sdk
ENV ANDROID_NDK_ROOT /opt/android/android-ndk
ENV PATH $PATH:$ANDROID_HOME/tools
ENV PATH $PATH:$ANDROID_HOME/platform-tools
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/

ENV ANDROID_NDK_HOST linux-x86_64

ENV ANDROID_SDKMANAGER $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager

# Install Android SDK
RUN yes | $ANDROID_SDKMANAGER --licenses && $ANDROID_SDKMANAGER --update
RUN $ANDROID_SDKMANAGER "platforms;android-17"
RUN $ANDROID_SDKMANAGER "platforms;android-28"
RUN $ANDROID_SDKMANAGER "platforms;android-30"
RUN $ANDROID_SDKMANAGER "build-tools;28.0.3"
RUN $ANDROID_SDKMANAGER "build-tools;30.0.2"


#5.15.2
ENV MY_QT_VERSION 5.15.2

# Download / install Qt
####ADD https://code.qt.io/cgit/qbs/qbs.git/plain/scripts/install-qt.sh ./
COPY install-qt.sh /install-qt.sh
RUN bash install-qt.sh --version $MY_QT_VERSION --target android --toolchain android qtbase qt3d qtdeclarative qtandroidextras qtconnectivity qtgamepad qtlocation qtmultimedia qtquickcontrols2 qtremoteobjects qtscxml qtsensors qtserialport qtsvg qtimageformats qttools qtspeech qtwebchannel qtwebsockets qtwebview qtxmlpatterns qttranslations

# Set the QTDIR environment variable
ENV QTDIR="/opt/Qt/$MY_QT_VERSION/android"


COPY build.sh /build.sh
RUN chmod +x /build.sh

ENTRYPOINT /bin/bash /build.sh


Loading