Skip to content

Commit

Permalink
Merge pull request #6 from CryZo/readme
Browse files Browse the repository at this point in the history
Created build pipeline to automatically generate readme.*.md
  • Loading branch information
CryZo authored Mar 30, 2024
2 parents 54a2aa4 + 7e099d0 commit 5deeb2e
Show file tree
Hide file tree
Showing 5 changed files with 166 additions and 6 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,36 @@ on:
push:
branches:
- main
paths:
- 'app/**/*'
- 'gradle/**/*'
- 'build.gradle.kts'

jobs:
Gradle:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v2

- name: setup jdk
uses: actions/setup-java@v1
with:
java-version: 17

- name: Make Gradle executable
run: chmod +x ./gradlew

- name: Build Release APK
run: ./gradlew assembleRelease

- name: Build Debug APK
run: ./gradlew assembleDebug

- name: version
run: echo "CUR_VERSION=$(grep -o -E 'versionName = \"[[:digit:]\.]+\"' app/build.gradle.kts | grep -o -E '[[:digit:]\.]+')" >> $GITHUB_OUTPUT
id: version

- name: Release
uses: softprops/action-gh-release@v2
with:
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build Docs

on:
push:
branches:
- main
paths:
- 'fastlane/**/*'
- 'scripts/generate-readme.sh'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Generate Readme
run: bash ${GITHUB_WORKSPACE}/scripts/generate-readme.sh

- name: Commit & Push
uses: Andro999b/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main
force: true
message: 'Overwritten by Github Actions'
30 changes: 30 additions & 0 deletions README.de.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<div>
<div align="left">
<img src="https://github.com/CryZo/PaintballNotificator/actions/workflows/android.yml/badge.svg"/>
</div>
<div align="right">
<a href="README.md">English</a> | <a href="README.de.md">Deutsch</a>
</div>
</div>

<div align="center">
<img src="fastlane/metadata/android/de/images/icon.png" alt="App icon" />
</div>

<h1>Paintball Notificator<br><sub>…damit du vor einem Match nicht mehr quer über den Platz brüllen musst.</sub></h1>

> Simple App, um Bescheid zu geben, wenn alle Teams bereit sind.
## Screenshots
| | | | |
|-|-|-|-|
| ![](fastlane/metadata/android/de/images/phoneScreenshots/1.png) | ![](fastlane/metadata/android/de/images/phoneScreenshots/2.png) | ![](fastlane/metadata/android/de/images/phoneScreenshots/3.png) | ![](fastlane/metadata/android/de/images/phoneScreenshots/4.png) |

## Changelog
v1.0.0:
- Material You Design
- Dark Mode

v1.1.0
- Die Match ID kann jetzt auch direkt geteilt werden. Dadurch muss sie nicht mehr abgetippt werden.

30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<div>
<div align="left">
<img src="https://github.com/CryZo/PaintballNotificator/actions/workflows/android.yml/badge.svg"/>
</div>
<div align="right">
<a href="README.md">English</a> | <a href="README.de.md">Deutsch</a>
</div>
</div>

<div align="center">
<img src="fastlane/metadata/android/en-US/images/icon.png" alt="App icon" />
</div>

<h1>Paintball Notificator<br><sub>…so that you no longer have to shout across the pitch before a match.</sub></h1>

> Simple app to let you know when all teams are ready.
## Screenshots
| | | | |
|-|-|-|-|
| ![](fastlane/metadata/android/en-US/images/phoneScreenshots/1.png) | ![](fastlane/metadata/android/en-US/images/phoneScreenshots/2.png) | ![](fastlane/metadata/android/en-US/images/phoneScreenshots/3.png) | ![](fastlane/metadata/android/en-US/images/phoneScreenshots/4.png) |

## Changelog
v1.0.0:
- Material You design
- Dark mode

v1.1.0
- You can share the match id now directly using the build in Android share sheet.

70 changes: 70 additions & 0 deletions scripts/generate-readme.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/bin/sh

cd $(dirname $0)/..

function header {
echo '<div>'
echo '<div align="left">'
echo '<img src="https://github.com/CryZo/PaintballNotificator/actions/workflows/android.yml/badge.svg"/>'
echo '<img src="https://github.com/CryZo/PaintballNotificator/actions/workflows/docs.yml/badge.svg"/>'
echo '</div>'
echo '<div align="right">'
echo -n '<a href="README.md">English</a> | '
echo '<a href="README.de.md">Deutsch</a>'
echo '</div>'
echo '</div>'
}

function generate_readme {
OUT=$1
LANG=$2
FASTLANE_PREFIX=fastlane/metadata/android/$LANG

header > $OUT
echo '' >> $OUT

echo '<div align="center">' >> $OUT
echo "<img src=\"$FASTLANE_PREFIX/images/icon.png\" alt=\"App icon\" />" >> $OUT
echo '</div>' >> $OUT
echo '' >> $OUT

echo "<h1>$(cat $FASTLANE_PREFIX/title.txt)<br><sub>$(cat $FASTLANE_PREFIX/short_description.txt)</sub></h1>" >> $OUT
echo '' >> $OUT
echo "> $(cat $FASTLANE_PREFIX/full_description.txt)" >> $OUT
echo '' >> $OUT


echo "## Screenshots" >> $OUT

echo -n "| " >> $OUT
for file in $FASTLANE_PREFIX/images/phoneScreenshots/*
do
echo -n " |" >> $OUT
done
echo "" >> $OUT

echo -n "|" >> $OUT
for file in $FASTLANE_PREFIX/images/phoneScreenshots/*
do
echo -n "-|" >> $OUT
done
echo "" >> $OUT

echo -n "| " >> $OUT
for file in $FASTLANE_PREFIX/images/phoneScreenshots/*
do
echo -n "![]($file) | " >> $OUT
done
echo -e '\n' >> $OUT


echo "## Changelog" >> $OUT
for file in $FASTLANE_PREFIX/changelogs/*
do
cat $file >> $OUT
echo -e '\n' >> $OUT
done
}

generate_readme README.md en-US
generate_readme README.de.md de

0 comments on commit 5deeb2e

Please sign in to comment.