Skip to content

Build WhatsApp

Build WhatsApp #56

name: Build WhatsApp
on:
schedule: [{cron: "0 0 1 * *"}]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Setup Node.js environment
uses: actions/setup-node@v3
- name: Install nativefier and jq
run: |
npm install -g nativefier && sudo apt install jq -y
- name: Build WhatsApp
run: bash ./build-whatsapp.sh
- name: Upload to release
run: |
VERSION="$(($(wget -qO- https://github.com/cycool29/whatsapp-for-linux/releases/latest | grep -m 1 -o "WhatsApp for Linux.*" | sed 's/WhatsApp for Linux //g' | head -c 2) + 1))"
gh release create ${VERSION}.0 --notes "An unofficial WhatsApp client for Linux, built with nativefier." -t "WhatsApp for Linux ${VERSION}.0"
gh release upload ${VERSION}.0 ./*.deb
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update docs config
run: |
VERSION="$(($(wget -qO- https://github.com/cycool29/whatsapp-for-linux/releases/latest | grep -m 1 -o "WhatsApp for Linux.*" | sed 's/WhatsApp for Linux //g' | head -c 2) + 1))"
sed -i "s/latest-version:.*/latest-version: ${VERSION}/g" ./docs/_config.yml
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git add ./docs/_config.yml
git diff-index --quiet HEAD || git commit -m "Update docs config"
git push