Skip to content

auto-update

auto-update #1577

Workflow file for this run

name: auto-update
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
env:
GIT_USER_NAME: github-actions[bot]
GIT_USER_EMAIL: github-actions[bot]@users.noreply.github.com
FLATPAK_ID: net.cozic.joplin_desktop
jobs:
flatpak-external-data-checker:
name: 'check update (${{ matrix.branch || github.ref_name }})'
runs-on: ubuntu-latest
strategy:
matrix:
branch: ['master', 'beta', '']
isShedule:
- ${{ github.event_name == 'schedule' }}
exclude:
- branch: 'master'
isShedule: false
- branch: 'beta'
isShedule: false
- branch: ''
isShedule: true
steps:
- uses: actions/checkout@v2
with:
ref: ${{ matrix.branch }}
- uses: docker://ghcr.io/flathub/flatpak-external-data-checker:latest
with:
args: --edit-only ${{ env.FLATPAK_ID }}.yml
- name: check updated
id: is-updated
run: |
git status -s -uno
[ -z "$(git status -s -uno)" ] || echo "::set-output name=updated::true"
- uses: actions/setup-python@v2
if: steps.is-updated.outputs.updated
with:
python-version: 3.9
- name: generate node sources
if: steps.is-updated.outputs.updated
run: |
git submodule update --init
ver=$(grep release net.cozic.joplin_desktop.appdata.xml | grep -m1 -oP '(?<=version=.)[^"]+')
pushd flatpak-builder-tools/node
curl https://raw.githubusercontent.com/laurent22/joplin/v${ver}/yarn.lock > yarn.lock
pip install poetry
poetry install
poetry run flatpak-node-generator yarn yarn.lock
popd
mv flatpak-builder-tools/node/generated-sources.json ./
- name: reset
run: |
git checkout -- ${FLATPAK_ID}.yml *.xml
- uses: docker://ghcr.io/flathub/flatpak-external-data-checker:latest
name: recheck and open pr
env:
GIT_AUTHOR_NAME: Flatpak External Data Checker
GIT_COMMITTER_NAME: Flatpak External Data Checker
GIT_AUTHOR_EMAIL: ${{ env.GIT_USER_NAME }}
GIT_COMMITTER_EMAIL: ${{ env.GIT_USER_EMAIL }}
EMAIL: ${{ env.GIT_USER_EMAIL }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: --update --never-fork ${{ env.FLATPAK_ID }}.yml