Build #716
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Create | |
id: create | |
run: | | |
./create_mod.sh -e -n | |
[ -z "$(git status -s)" ] && exit | |
VERSION=$(sed -n 's/^versionCode=//p' module.prop) | |
echo "VERSION=$VERSION" >>"$GITHUB_OUTPUT" | |
{ | |
echo "CHANGELOG<<EOF" | |
FLAG=false | |
while IFS= read -r line; do | |
if echo "$line" | grep -qs "^###"; then | |
[ "$FLAG" = true ] && break | |
FLAG=true | |
fi | |
echo "$line" | |
done <CHANGELOG.md | |
echo "EOF" | |
} >>"$GITHUB_OUTPUT" | |
- name: Update the module | |
if: ${{ steps.create.outputs.VERSION != '' }} | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: Bump version to ${{ steps.create.outputs.VERSION }} | |
- name: Release | |
id: release | |
if: ${{ steps.create.outputs.VERSION != '' }} | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: ${{ steps.create.outputs.VERSION }} | |
body: ${{ steps.create.outputs.CHANGELOG }} | |
files: build/* | |
- name: Update update.json | |
if: ${{ steps.create.outputs.VERSION != '' }} | |
env: | |
VERSION: ${{ steps.create.outputs.VERSION }} | |
ASSETS: ${{ steps.release.outputs.assets }} | |
run: | | |
echo "$ASSETS" | jq -c .[] | while IFS= read -r asset; do | |
name=$(echo "$asset" | jq -r '.name') | |
dl_url=$(echo "$asset" | jq -r '.browser_download_url') | |
case $name in | |
org.fdroid.fdroid.privileged.mod_*.zip) | |
jq ".version = \"$VERSION\" | .versionCode = $VERSION | .zipUrl = \"$dl_url\"" update.json >update.json.tmp | |
mv update.json.tmp update.json | |
;; | |
org.fdroid.fdroid.privileged.mod.netinst_*.zip) | |
jq ".version = \"$VERSION\" | .versionCode = $VERSION | .zipUrl = \"$dl_url\"" update.json >update-netinst.json | |
;; | |
esac | |
done | |
- name: Commit update.json | |
if: ${{ steps.create.outputs.VERSION != '' }} | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: Bump update.json to ${{ steps.create.outputs.VERSION }} |