-
Notifications
You must be signed in to change notification settings - Fork 10
77 lines (67 loc) · 2.37 KB
/
auto-update.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
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