Skip to content

Commit

Permalink
updated credits and workflows, created patch notes
Browse files Browse the repository at this point in the history
  • Loading branch information
Arne-Weber committed May 17, 2024
1 parent 9cc74c1 commit b5612d8
Show file tree
Hide file tree
Showing 5 changed files with 281 additions and 21 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/Check_patch_notes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Check patch notes

on:
pull_request:
branches:
- main # Adjust to match your main branch name

jobs:
check_documentation:
runs-on: ubuntu-latest

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

- name: Check for patch notes changes
run: |
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q '^patch_notes.txt$'; then
echo "Patch notes updated."
else
echo "Update patch notes!"
exit 1
fi
246 changes: 246 additions & 0 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,246 @@
name: Build release

on:
pull_request:
types: [closed]
branches:
- 'master'
workflow_dispatch:

env:
PYTHON_VERSION: '3.10'

jobs:
windows:
name: Windows
runs-on: windows-latest

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

- name: Set up variables
id: vars
run: |
Add-Content $env:GITHUB_OUTPUT "sha_short=$(git rev-parse --short HEAD)"
- name: Append git revision to project version
run: |
(Get-Content version.py) `
-Replace '^__version__\s*=\s*"[^"]+', "`$0.${{steps.vars.outputs.sha_short}}" |`
Out-File version.py
# Ensure Python version
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{env.PYTHON_VERSION}}

- name: Install project dependencies
run: |
python3 -m pip install wheel
python3 -m pip install -r requirements.txt
- name: Install UPX
run: |
Invoke-WebRequest -Uri https://github.com/upx/upx/releases/download/v4.0.2/upx-4.0.2-win64.zip -OutFile (Join-Path $env:Temp upx.zip)
Expand-Archive -LiteralPath (Join-Path $env:Temp upx.zip) -DestinationPath $env:Temp
Move-Item -Path (Join-Path $env:Temp upx-*) -Destination (Join-Path $env:Temp upx)
Add-Content $env:GITHUB_PATH (Join-Path $env:Temp upx)
- name: Install PyInstaller
run: |
python3 -m pip install pyinstaller
- name: Create portable executable
run: |
pyinstaller build.spec
- name: Create release folder
run: |
$FolderName = 'Twitch Drops Miner'
New-Item $FolderName -ItemType Directory
Copy-Item dist\*.exe $FolderName
Copy-Item manual.txt $FolderName
Compress-Archive -Path $FolderName -DestinationPath Twitch.Drops.Miner.Windows.zip
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: Twitch.Drops.Miner.Windows
path: Twitch.Drops.Miner.Windows.zip

linux-pyinstaller:
name: Linux (PyInstaller)
runs-on: ubuntu-20.04

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

- name: Set up variables
id: vars
run: |
echo "sha_short=$(git rev-parse --short HEAD)" >> "${GITHUB_OUTPUT}"
- name: Append git revision to project version
run: |
sed -ri "s/^__version__\s*=\s*\"[^\"]+/\0.${{ steps.vars.outputs.sha_short }}/" version.py
# NOTE: We're only use a custom version of Python here because truststore requires at least Python 3.10, but Ubuntu 20.04 has Python 3.8.
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{env.PYTHON_VERSION}}

- name: Install system dependencies
run: |
sudo apt update
sudo apt install gir1.2-appindicator3-0.1 libgirepository1.0-dev python3-tk
- name: Install project dependencies
run: |
python3 -m pip install wheel
python3 -m pip install -r requirements.txt
- name: Install PyInstaller
run: |
python3 -m pip install pyinstaller
# NOTE: Remove this step if/once libxft gets updated to 2.3.5 or newer on Ubuntu 20.04, which currently has 2.3.3.
- name: Build a recent version of libXft
run: |
mkdir -p /tmp/libXft
cd /tmp/libXft
curl -L https://xorg.freedesktop.org/releases/individual/lib/libXft-2.3.8.tar.xz -o libXft.tar.xz
tar xvf libXft.tar.xz
cd libXft-*
./configure --prefix=/tmp/libXft --sysconfdir=/etc --disable-static
make
make install-strip
- name: Create portable executable
run: |
LD_LIBRARY_PATH=/tmp/libXft/lib xvfb-run --auto-servernum pyinstaller build.spec
- name: Show PyInstaller warnings
run: |
cat build/build/warn-build.txt || true
- name: Create release folder
run: |
folder='Twitch Drops Miner'
mkdir "${folder}"
cp manual.txt dist/* "${folder}"
7z a Twitch.Drops.Miner.Linux.PyInstaller.zip "${folder}"
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: Twitch.Drops.Miner.Linux.PyInstaller
path: Twitch.Drops.Miner.Linux.PyInstaller.zip

linux-appimage:
name: Linux (AppImage)
runs-on: ubuntu-22.04

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

- name: Set up variables
id: vars
run: |
echo "app_version=$(python3 -c 'from version import __version__ as v; print(v)')" >> "${GITHUB_OUTPUT}"
echo "sha_short=$(git rev-parse --short HEAD)" >> "${GITHUB_OUTPUT}"
- name: Append git revision to project version
run: |
sed -ri "s/^__version__\s*=\s*\"[^\"]+/\0.${{steps.vars.outputs.sha_short}}/" version.py
- name: Install system dependencies
run: |
sudo apt update
sudo apt install libgirepository1.0-dev python3-testresources
- name: Download AppImage Builder
run: |
curl -L https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.1.0/appimage-builder-1.1.0-x86_64.AppImage -o appimage-builder
chmod +x appimage-builder
- name: Create AppImage
env:
APPIMAGE_EXTRACT_AND_RUN: 1
APP_VERSION: ${{steps.vars.outputs.app_version}}.${{steps.vars.outputs.sha_short}}
PYTHON_VERSION: ${{env.PYTHON_VERSION}}
run: |
./appimage-builder --recipe appimage/AppImageBuilder.yml
- name: Create release folder
run: |
folder='Twitch Drops Miner'
mkdir "${folder}"
cp *.AppImage manual.txt "${folder}"
7z a Twitch.Drops.Miner.Linux.AppImage.zip "${folder}"
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: Twitch.Drops.Miner.Linux.AppImage
path: Twitch.Drops.Miner.Linux.AppImage.zip

update_releases_page:
name: Upload builds to Releases
if: github.event_name != 'pull_request'
needs:
- windows
- linux-pyinstaller
- linux-appimage
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Set up variables
id: vars
run: |
echo "date_now=$(date --rfc-3339=seconds)" >> "${GITHUB_OUTPUT}"
- name: Download build artifacts from previous jobs
uses: actions/download-artifact@v4
with:
path: artifacts

- name: Read patch notes from file
id: read_patch_notes
run: |
PATCH_NOTES=$(cat patch_notes.txt)
echo "patch_notes=$PATCH_NOTES" >> $GITHUB_ENV
- name: Upload builds to Releases
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: artifacts/*/*
body: |
# ⚠️ Please help with translation as tracked in #2 !
***
**This is an automatically generated updated version of the application, that includes the latest master branch changes.**
**This build should be stable, but if you encounter anything, please reoirt any issues you find.**
- Last build date: `${{ steps.vars.outputs.date_now }}`
- Reference commit: ${{ github.sha }}
***
## Patch notes:
${{ env.patch_notes }}
name: Updated build
prerelease: false
removeArtifacts: true
tag: v15
27 changes: 9 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: Build
name: Build dev version

on:
push:
branches:
- 'master'
- 'in-dev'
pull_request:
branches:
- 'in-dev'
workflow_dispatch:

env:
Expand Down Expand Up @@ -214,12 +216,6 @@ jobs:
with:
path: artifacts

- name: Read patch notes from file
id: read_patch_notes
run: |
PATCH_NOTES=$(cat patch_notes.txt)
echo "patch_notes=$PATCH_NOTES" >> $GITHUB_ENV
- name: Upload builds to Releases
uses: ncipollo/release-action@v1
with:
Expand All @@ -230,17 +226,12 @@ jobs:
# ⚠️ Please help with translation as tracked in #2 !
***
**This is an automatically generated in-development pre-release version of the application, that includes the latest master branch changes.**
**⚠️ This build should, but might not be stable and may end up terminating with a fatal error. ⚠️**
**Use at your own risk and please report issues.**
- Last build date: `${{ steps.vars.outputs.date_now }}`
- Reference commit: ${{ github.sha }}
***
## Patch notes:
${{ env.patch_notes }}
**This is an automatically generated in-development pre-release version of the application, that includes the latest in-dev branch changes.**
**⚠️ This build is not stable and may end up terminating with a fatal error. ⚠️**
**Use at your own risk.**
- Last build date: `${{steps.vars.outputs.date_now}}`
- Reference commit: ${{github.sha}}
name: Development build
prerelease: true
removeArtifacts: true
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,4 @@ if they aren't already there. Doing so ensures proper markdown rendering on Gith
@Bamboozul - For the entirety of the Arabic (العربية) translation.
@Kjerne - For the entirety of the Danish (Dansk) translation.

@Kuddus73 - For updating the "How It Works" Translations.
@Kuddus73, @VSeryi, @Windows200000, @BreakshadowCN - For updating the "How It Works" Translations.
4 changes: 2 additions & 2 deletions patch_notes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
### 17.5.2024
- added Italian translation and credits
- updated ci.yml to include these patch notes
- Updated Italian, Simplified Chineese and Spanish translation as well as corresponding credits
- Various changes to github workflows

0 comments on commit b5612d8

Please sign in to comment.