Skip to content

Commit

Permalink
Try release note autogen
Browse files Browse the repository at this point in the history
  • Loading branch information
tmolitor-stud-tu committed Apr 25, 2024
1 parent 50c54ee commit 5321a82
Showing 1 changed file with 155 additions and 135 deletions.
290 changes: 155 additions & 135 deletions .github/workflows/autorelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,81 +10,81 @@ on:
jobs:
# see https://data-dive.com/multi-os-deployment-in-cloud-using-pyinstaller-and-github-actions/
# but here we build first and run our createrelease job afterwards, accessing the artifacts of our build job
build-android:
name: Build MobileCrashAnalyzer for android
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install dependencies
run: sudo apt -y install apksigner

- name: Prepare app for buildozer
run: |
REFNAME="${{ github.ref_name }}"
echo "VERSION='${REFNAME}'" >src/shared/utils/version.py
mkdir MobileCrashAnalyzer_Deploy
cp -av src/MobileCrashAnalyzer.py MobileCrashAnalyzer_Deploy/
cp -av src/MobileCrashAnalyzer MobileCrashAnalyzer_Deploy/
cp -av src/shared MobileCrashAnalyzer_Deploy/
cp -av src/MobileCrashAnalyzer/data/conf/intent_filters.xml MobileCrashAnalyzer_Deploy/
cp -av src/MobileCrashAnalyzer/data/conf/buildozer.spec MobileCrashAnalyzer_Deploy/
echo "" >>MobileCrashAnalyzer_Deploy/buildozer.spec
# buildozer does not like non-numeric version numbers
echo "version = ${REFNAME#v}" >>MobileCrashAnalyzer_Deploy/buildozer.spec
# dynamically build main.py proxy to load
echo "import os" >MobileCrashAnalyzer_Deploy/main.py
echo "os.environ['KIVY_LOG_MODE'] = 'MIXED'" >>MobileCrashAnalyzer_Deploy/main.py
echo "os.environ['KIVY_NO_FILELOG'] = '1'" >>MobileCrashAnalyzer_Deploy/main.py
echo "from importlib import util" >>MobileCrashAnalyzer_Deploy/main.py
echo "real_file = os.path.join(os.path.dirname(__file__), 'MobileCrashAnalyzer.pyc')" >>MobileCrashAnalyzer_Deploy/main.py
echo "print('Proxy loading real file: %s' % real_file)" >>MobileCrashAnalyzer_Deploy/main.py
echo "" >>MobileCrashAnalyzer_Deploy/main.py
echo "spec = util.spec_from_file_location('MobileCrashAnalyzer', real_file)" >>MobileCrashAnalyzer_Deploy/main.py
echo "print(f'{spec = }')" >>MobileCrashAnalyzer_Deploy/main.py
echo "mod = util.module_from_spec(spec)" >>MobileCrashAnalyzer_Deploy/main.py
echo "# we don't want to add our module to sys.modules to not interfere with the package path having the same name" >>MobileCrashAnalyzer_Deploy/main.py
echo "#(just like if our real_file was the real entry point)" >>MobileCrashAnalyzer_Deploy/main.py
echo "print(f'{mod = }')" >>MobileCrashAnalyzer_Deploy/main.py
echo "out = spec.loader.exec_module(mod)" >>MobileCrashAnalyzer_Deploy/main.py
echo "print(f'{out = }')" >>MobileCrashAnalyzer_Deploy/main.py
echo "print('Proxied file returned, terminating...')" >>MobileCrashAnalyzer_Deploy/main.py
echo ""
echo "buildozer.spec:"
cat MobileCrashAnalyzer_Deploy/buildozer.spec
echo ""
echo "main.py:"
cat MobileCrashAnalyzer_Deploy/main.py
- name: Build with Buildozer
uses: Sobottasgithub/buildozer-action@v1.1.3
id: buildozer
with:
workdir: MobileCrashAnalyzer_Deploy
buildozer_version: stable

- name: Sign Apk
id: signer
run: |
apkinfile="${{ steps.buildozer.outputs.filename }}"
apkoutfile="$HOME/signed-$(basename "${apkinfile}")"
echo -n "${{ secrets.APK_SIGNING_KEY }}" >"$HOME/keystore.key"
openssl enc -d -chacha20 -pbkdf2 -in src/MobileCrashAnalyzer/data/conf/release.keystore.enc -out "$HOME/release.keystore" -kfile "$HOME/keystore.key"
cat "$HOME/keystore.key" | apksigner sign -ks "$HOME/release.keystore" -in "${apkinfile}" -out "${apkoutfile}"
echo "unsigned_apk=${apkinfile}" >> "$GITHUB_OUTPUT"
echo "signed_apk=${apkoutfile}" >> "$GITHUB_OUTPUT"
- name: Upload signed apk
uses: actions/upload-artifact@v4
with:
name: MobileCrashAnalyzer
path: ${{ steps.signer.outputs.signed_apk }}
# build-android:
# name: Build MobileCrashAnalyzer for android
# runs-on: ubuntu-latest
#
# steps:
# - name: Checkout
# uses: actions/checkout@v4
#
# - name: Install dependencies
# run: sudo apt -y install apksigner
#
# - name: Prepare app for buildozer
# run: |
# REFNAME="${{ github.ref_name }}"
# echo "VERSION='${REFNAME}'" >src/shared/utils/version.py
#
# mkdir MobileCrashAnalyzer_Deploy
# cp -av src/MobileCrashAnalyzer.py MobileCrashAnalyzer_Deploy/
# cp -av src/MobileCrashAnalyzer MobileCrashAnalyzer_Deploy/
# cp -av src/shared MobileCrashAnalyzer_Deploy/
#
# cp -av src/MobileCrashAnalyzer/data/conf/intent_filters.xml MobileCrashAnalyzer_Deploy/
# cp -av src/MobileCrashAnalyzer/data/conf/buildozer.spec MobileCrashAnalyzer_Deploy/
# echo "" >>MobileCrashAnalyzer_Deploy/buildozer.spec
# # buildozer does not like non-numeric version numbers
# echo "version = ${REFNAME#v}" >>MobileCrashAnalyzer_Deploy/buildozer.spec
#
# # dynamically build main.py proxy to load
# echo "import os" >MobileCrashAnalyzer_Deploy/main.py
# echo "os.environ['KIVY_LOG_MODE'] = 'MIXED'" >>MobileCrashAnalyzer_Deploy/main.py
# echo "os.environ['KIVY_NO_FILELOG'] = '1'" >>MobileCrashAnalyzer_Deploy/main.py
# echo "from importlib import util" >>MobileCrashAnalyzer_Deploy/main.py
# echo "real_file = os.path.join(os.path.dirname(__file__), 'MobileCrashAnalyzer.pyc')" >>MobileCrashAnalyzer_Deploy/main.py
# echo "print('Proxy loading real file: %s' % real_file)" >>MobileCrashAnalyzer_Deploy/main.py
# echo "" >>MobileCrashAnalyzer_Deploy/main.py
# echo "spec = util.spec_from_file_location('MobileCrashAnalyzer', real_file)" >>MobileCrashAnalyzer_Deploy/main.py
# echo "print(f'{spec = }')" >>MobileCrashAnalyzer_Deploy/main.py
# echo "mod = util.module_from_spec(spec)" >>MobileCrashAnalyzer_Deploy/main.py
# echo "# we don't want to add our module to sys.modules to not interfere with the package path having the same name" >>MobileCrashAnalyzer_Deploy/main.py
# echo "#(just like if our real_file was the real entry point)" >>MobileCrashAnalyzer_Deploy/main.py
# echo "print(f'{mod = }')" >>MobileCrashAnalyzer_Deploy/main.py
# echo "out = spec.loader.exec_module(mod)" >>MobileCrashAnalyzer_Deploy/main.py
# echo "print(f'{out = }')" >>MobileCrashAnalyzer_Deploy/main.py
# echo "print('Proxied file returned, terminating...')" >>MobileCrashAnalyzer_Deploy/main.py
#
# echo ""
# echo "buildozer.spec:"
# cat MobileCrashAnalyzer_Deploy/buildozer.spec
# echo ""
# echo "main.py:"
# cat MobileCrashAnalyzer_Deploy/main.py
#
# - name: Build with Buildozer
# uses: Sobottasgithub/buildozer-action@v1.1.3
# id: buildozer
# with:
# workdir: MobileCrashAnalyzer_Deploy
# buildozer_version: stable
#
# - name: Sign Apk
# id: signer
# run: |
# apkinfile="${{ steps.buildozer.outputs.filename }}"
# apkoutfile="$HOME/signed-$(basename "${apkinfile}")"
# echo -n "${{ secrets.APK_SIGNING_KEY }}" >"$HOME/keystore.key"
# openssl enc -d -chacha20 -pbkdf2 -in src/MobileCrashAnalyzer/data/conf/release.keystore.enc -out "$HOME/release.keystore" -kfile "$HOME/keystore.key"
# cat "$HOME/keystore.key" | apksigner sign -ks "$HOME/release.keystore" -in "${apkinfile}" -out "${apkoutfile}"
# echo "unsigned_apk=${apkinfile}" >> "$GITHUB_OUTPUT"
# echo "signed_apk=${apkoutfile}" >> "$GITHUB_OUTPUT"
#
# - name: Upload signed apk
# uses: actions/upload-artifact@v4
# with:
# name: MobileCrashAnalyzer
# path: ${{ steps.signer.outputs.signed_apk }}

build-desktop:
name: Build ${{ matrix.OUT_FILE_NAME }} for ${{ matrix.TARGET }}
Expand All @@ -93,26 +93,26 @@ jobs:
matrix:
include:
# LogViewer
- os: macos-latest
TARGET: macos
#--volicon "Hello World.icns" \
# for the dmg stuff, see https://www.pythonguis.com/tutorials/packaging-pyqt5-applications-pyinstaller-macos-dmg/
CMD_BUILD: >
pyinstaller --clean --log-level DEBUG --name "LogViewer" --add-data "LogViewer/data:LogViewer/data" --add-data "shared/ui/*.ui:shared/ui" --add-data "LogViewer/ui/*.ui:LogViewer/ui" --specpath src --windowed --icon LogViewer/data/art/icon.png --onefile --debug bootloader --argv-emulation src/LogViewer.py &&
cd dist/ &&
zip -r9 LogViewer LogViewer.app/ &&
brew install create-dmg &&
mkdir -p dmg &&
cp -vr "LogViewer.app" dmg/ &&
create-dmg --volname "LogViewer" --volicon LogViewer.app/Contents/Resources/generated-* --window-pos 200 120 --window-size 600 300 --icon-size 100 --icon "LogViewer.app" 175 120 --hide-extension "LogViewer.app" --app-drop-link 425 120 "LogViewer.dmg" "./dmg/"
OUT_FILE_NAME: LogViewer.dmg
ASSET_MIME: application/binary
- os: windows-latest
TARGET: windows
CMD_BUILD: >
pyinstaller --clean --log-level DEBUG --name "LogViewer" --add-data "LogViewer/data;LogViewer/data" --add-data "shared/ui/*.ui;shared/ui" --add-data "LogViewer/ui/*.ui;LogViewer/ui" --specpath src --windowed --icon LogViewer/data/art/icon.png --onefile --debug bootloader src/LogViewer.py
OUT_FILE_NAME: LogViewer.exe
ASSET_MIME: application/vnd.microsoft.portable-executable
# - os: macos-latest
# TARGET: macos
# #--volicon "Hello World.icns" \
# # for the dmg stuff, see https://www.pythonguis.com/tutorials/packaging-pyqt5-applications-pyinstaller-macos-dmg/
# CMD_BUILD: >
# pyinstaller --clean --log-level DEBUG --name "LogViewer" --add-data "LogViewer/data:LogViewer/data" --add-data "shared/ui/*.ui:shared/ui" --add-data "LogViewer/ui/*.ui:LogViewer/ui" --specpath src --windowed --icon LogViewer/data/art/icon.png --onefile --debug bootloader --argv-emulation src/LogViewer.py &&
# cd dist/ &&
# zip -r9 LogViewer LogViewer.app/ &&
# brew install create-dmg &&
# mkdir -p dmg &&
# cp -vr "LogViewer.app" dmg/ &&
# create-dmg --volname "LogViewer" --volicon LogViewer.app/Contents/Resources/generated-* --window-pos 200 120 --window-size 600 300 --icon-size 100 --icon "LogViewer.app" 175 120 --hide-extension "LogViewer.app" --app-drop-link 425 120 "LogViewer.dmg" "./dmg/"
# OUT_FILE_NAME: LogViewer.dmg
# ASSET_MIME: application/binary
# - os: windows-latest
# TARGET: windows
# CMD_BUILD: >
# pyinstaller --clean --log-level DEBUG --name "LogViewer" --add-data "LogViewer/data;LogViewer/data" --add-data "shared/ui/*.ui;shared/ui" --add-data "LogViewer/ui/*.ui;LogViewer/ui" --specpath src --windowed --icon LogViewer/data/art/icon.png --onefile --debug bootloader src/LogViewer.py
# OUT_FILE_NAME: LogViewer.exe
# ASSET_MIME: application/vnd.microsoft.portable-executable
- os: ubuntu-latest
TARGET: linux
#sudo apt install plasma-integration -y &&
Expand All @@ -125,26 +125,26 @@ jobs:
ASSET_MIME: application/x-executable

# CrashAnalyzer
- os: macos-latest
TARGET: macos
#--volicon "Hello World.icns" \
# for the dmg stuff, see https://www.pythonguis.com/tutorials/packaging-pyqt5-applications-pyinstaller-macos-dmg/
CMD_BUILD: >
pyinstaller --clean --log-level DEBUG --name "CrashAnalyzer" --add-data "CrashAnalyzer/data:CrashAnalyzer/data" --add-data "shared/ui/*.ui:shared/ui" --add-data "CrashAnalyzer/ui/*.ui:CrashAnalyzer/ui" --specpath src --windowed --icon CrashAnalyzer/data/art/icon.png --onefile --debug bootloader --argv-emulation src/CrashAnalyzer.py &&
cd dist/ &&
zip -r9 CrashAnalyzer CrashAnalyzer.app/ &&
brew install create-dmg &&
mkdir -p dmg &&
cp -vr "CrashAnalyzer.app" dmg/ &&
create-dmg --volname "CrashAnalyzer" --volicon CrashAnalyzer.app/Contents/Resources/generated-* --window-pos 200 120 --window-size 600 300 --icon-size 100 --icon "CrashAnalyzer.app" 175 120 --hide-extension "CrashAnalyzer.app" --app-drop-link 425 120 "CrashAnalyzer.dmg" "./dmg/"
OUT_FILE_NAME: CrashAnalyzer.dmg
ASSET_MIME: application/binary
- os: windows-latest
TARGET: windows
CMD_BUILD: >
pyinstaller --clean --log-level DEBUG --name "CrashAnalyzer" --add-data "CrashAnalyzer/data;CrashAnalyzer/data" --add-data "shared/ui/*.ui;shared/ui" --add-data "CrashAnalyzer/ui/*.ui;CrashAnalyzer/ui" --specpath src --windowed --icon CrashAnalyzer/data/art/icon.png --onefile --debug bootloader src/CrashAnalyzer.py
OUT_FILE_NAME: CrashAnalyzer.exe
ASSET_MIME: application/vnd.microsoft.portable-executable
# - os: macos-latest
# TARGET: macos
# #--volicon "Hello World.icns" \
# # for the dmg stuff, see https://www.pythonguis.com/tutorials/packaging-pyqt5-applications-pyinstaller-macos-dmg/
# CMD_BUILD: >
# pyinstaller --clean --log-level DEBUG --name "CrashAnalyzer" --add-data "CrashAnalyzer/data:CrashAnalyzer/data" --add-data "shared/ui/*.ui:shared/ui" --add-data "CrashAnalyzer/ui/*.ui:CrashAnalyzer/ui" --specpath src --windowed --icon CrashAnalyzer/data/art/icon.png --onefile --debug bootloader --argv-emulation src/CrashAnalyzer.py &&
# cd dist/ &&
# zip -r9 CrashAnalyzer CrashAnalyzer.app/ &&
# brew install create-dmg &&
# mkdir -p dmg &&
# cp -vr "CrashAnalyzer.app" dmg/ &&
# create-dmg --volname "CrashAnalyzer" --volicon CrashAnalyzer.app/Contents/Resources/generated-* --window-pos 200 120 --window-size 600 300 --icon-size 100 --icon "CrashAnalyzer.app" 175 120 --hide-extension "CrashAnalyzer.app" --app-drop-link 425 120 "CrashAnalyzer.dmg" "./dmg/"
# OUT_FILE_NAME: CrashAnalyzer.dmg
# ASSET_MIME: application/binary
# - os: windows-latest
# TARGET: windows
# CMD_BUILD: >
# pyinstaller --clean --log-level DEBUG --name "CrashAnalyzer" --add-data "CrashAnalyzer/data;CrashAnalyzer/data" --add-data "shared/ui/*.ui;shared/ui" --add-data "CrashAnalyzer/ui/*.ui;CrashAnalyzer/ui" --specpath src --windowed --icon CrashAnalyzer/data/art/icon.png --onefile --debug bootloader src/CrashAnalyzer.py
# OUT_FILE_NAME: CrashAnalyzer.exe
# ASSET_MIME: application/vnd.microsoft.portable-executable
- os: ubuntu-latest
TARGET: linux
#sudo apt install plasma-integration -y &&
Expand Down Expand Up @@ -184,41 +184,61 @@ jobs:
createrelease:
name: Create Release
runs-on: [ubuntu-latest]
needs: [build-desktop, build-android]
needs: [build-desktop]
#, build-android]
steps:
- name: Load build artifacts
uses: actions/download-artifact@v4
- name: Generate release changelog
# - name: Generate release changelog
# id: releasenotes
# uses: heinrichreimer/action-github-changelog-generator@v2.4
# with:
# issues: true
# issuesWoLabels: true
# pullRequests: true
# prWoLabels: true
# filterByMilestone: true
# author: true
# usernamesAsGithubLogins: true
# compareLink: true
# issueLineLabels: ALL
# simpleList: false
# releaseBranch: master
# httpCache: false
# verbose: true
# stripGeneratorNotice: true
# token: ${{ secrets.GITHUB_TOKEN }}

# - name: Upload Release Asset
# id: upload-release-asset
# uses: tanyagray/action-upload-release-asset@v1.1.3
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./my-artifact.zip
# asset_name: my-artifact.zip
# asset_content_type: application/zip

- name: Generate release notes
id: releasenotes
uses: heinrichreimer/action-github-changelog-generator@v2.4
uses: tmolitor-stud-tu/github-releasenotes-generator@v2.3.0
with:
issues: true
issuesWoLabels: true
pullRequests: true
prWoLabels: true
filterByMilestone: true
author: true
usernamesAsGithubLogins: true
compareLink: true
issueLineLabels: ALL
simpleList: false
releaseBranch: master
httpCache: false
verbose: true
stripGeneratorNotice: true
token: ${{ secrets.GITHUB_TOKEN }}
NO_CREATE_RELEASE: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Release
uses: softprops/action-gh-release@v2
with:
name: Release ${{ github.ref_name }}
tag_name: ${{ github.ref }}
target_commitish: master
generate_release_notes: false
body: ${{ steps.releasenotes.outputs.changelog }}
body: ${{ steps.releasenotes.outputs.notes }}
# MobileCrashAnalyzer*/*
files: |
LogViewer*/*
CrashAnalyzer*/*
MobileCrashAnalyzer*/*
fail_on_unmatched_files: true
token: ${{ secrets.GITHUB_TOKEN }}
draft: false

0 comments on commit 5321a82

Please sign in to comment.