Skip to content

Commit 499510d

Browse files
committed
Merge commit 'aeabcda6893e6dc1720ca58bdb3fbe528ed02e2a' as 'notify_push'
2 parents db0ae00 + aeabcda commit 499510d

File tree

97 files changed

+19291
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+19291
-0
lines changed

notify_push/.dockerignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
2+
# SPDX-License-Identifier: AGPL-3.0-or-later
3+
target
4+
lib
5+
test_client
6+
build
7+
vendor
8+
bin

notify_push/.envrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake

notify_push/.github/CODEOWNERS

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# App maintainers
2+
/appinfo/ @icewind1991 @max-nextcloud
3+
/img/ @icewind1991 @max-nextcloud
4+
/src/ @icewind1991 @max-nextcloud
5+
/test_client/ @icewind1991 @max-nextcloud
6+
/tests/ @icewind1991 @max-nextcloud
7+
/vendor-bin/**/*.json @icewind1991 @max-nextcloud
8+
Dockerfile @icewind1991 @max-nextcloud
9+
*.json @icewind1991 @max-nextcloud
10+
*.md @icewind1991 @max-nextcloud
11+
*.rs @icewind1991 @max-nextcloud
12+
*.toml @icewind1991 @max-nextcloud
13+
*.xml @icewind1991 @max-nextcloud

notify_push/.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
2+
# SPDX-License-Identifier: AGPL-3.0-or-later
3+
version: 2
4+
updates:
5+
- package-ecosystem: cargo
6+
directory: "/"
7+
schedule:
8+
interval: weekly
9+
day: tuesday
10+
time: "02:00"
11+
open-pull-requests-limit: 10
Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
# This workflow is provided via the organization template repository
2+
#
3+
# https://github.com/nextcloud/.github
4+
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
5+
#
6+
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
7+
# SPDX-License-Identifier: MIT
8+
9+
name: Build and publish app release
10+
11+
on:
12+
release:
13+
types: [published]
14+
15+
permissions:
16+
contents: write
17+
18+
jobs:
19+
build_and_publish:
20+
runs-on: ubuntu-latest
21+
22+
# Only allowed to be run on nextcloud-releases repositories
23+
if: ${{ github.repository_owner == 'nextcloud-releases' }}
24+
25+
steps:
26+
- uses: cachix/install-nix-action@fc6e360bedc9ee72d75e701397f0bb30dce77568 # v31.5.2
27+
- uses: cachix/cachix-action@0fc020193b5a1fa3ac4575aa3a7d3aa6a35435ad # v16
28+
with:
29+
name: notify-push
30+
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
31+
32+
- name: Check actor permission
33+
uses: skjnldsv/check-actor-permission@69e92a3c4711150929bca9fcf34448c5bf5526e7 # v3.0
34+
with:
35+
require: write
36+
37+
- name: Set app env
38+
run: |
39+
# Split and keep last
40+
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
41+
echo "APP_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
42+
43+
- name: Checkout
44+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
45+
with:
46+
persist-credentials: false
47+
path: ${{ env.APP_NAME }}
48+
fetch-depth: 0
49+
50+
- name: Get app version number
51+
id: app-version
52+
uses: skjnldsv/xpath-action@f5b036e9d973f42c86324833fd00be90665fbf77 # v1.0.0
53+
with:
54+
filename: ${{ env.APP_NAME }}/appinfo/info.xml
55+
expression: "//info//version/text()"
56+
57+
- name: Validate app version against tag
58+
run: |
59+
[ "${{ env.APP_VERSION }}" = "v${{ fromJSON(steps.app-version.outputs.result).version }}" ]
60+
61+
- name: Get appinfo data
62+
id: appinfo
63+
uses: skjnldsv/xpath-action@f5b036e9d973f42c86324833fd00be90665fbf77 # v1.0.0
64+
with:
65+
filename: ${{ env.APP_NAME }}/appinfo/info.xml
66+
expression: "//info//dependencies//nextcloud/@min-version"
67+
68+
- name: Read package.json node and npm engines version
69+
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
70+
id: versions
71+
# Continue if no package.json
72+
continue-on-error: true
73+
with:
74+
path: ${{ env.APP_NAME }}
75+
fallbackNode: '^20'
76+
fallbackNpm: '^10'
77+
78+
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
79+
# Skip if no package.json
80+
if: ${{ steps.versions.outputs.nodeVersion }}
81+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
82+
with:
83+
node-version: ${{ steps.versions.outputs.nodeVersion }}
84+
85+
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
86+
# Skip if no package.json
87+
if: ${{ steps.versions.outputs.npmVersion }}
88+
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
89+
90+
- name: Get php version
91+
id: php-versions
92+
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
93+
with:
94+
filename: ${{ env.APP_NAME }}/appinfo/info.xml
95+
96+
- name: Set up php ${{ steps.php-versions.outputs.php-min }}
97+
uses: shivammathur/setup-php@ccf2c627fe61b1b4d924adfcbd19d661a18133a0 # v2.35.2
98+
with:
99+
php-version: ${{ steps.php-versions.outputs.php-min }}
100+
coverage: none
101+
env:
102+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
103+
104+
- name: Check composer.json
105+
id: check_composer
106+
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
107+
with:
108+
files: "${{ env.APP_NAME }}/composer.json"
109+
110+
- name: Install composer dependencies
111+
if: steps.check_composer.outputs.files_exists == 'true'
112+
run: |
113+
cd ${{ env.APP_NAME }}
114+
composer install --no-dev
115+
116+
- name: Build ${{ env.APP_NAME }}
117+
# Skip if no package.json
118+
if: ${{ steps.versions.outputs.nodeVersion }}
119+
env:
120+
CYPRESS_INSTALL_BINARY: 0
121+
run: |
122+
cd ${{ env.APP_NAME }}
123+
npm ci
124+
npm run build --if-present
125+
126+
- name: Check Krankerl config
127+
id: krankerl
128+
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
129+
with:
130+
files: ${{ env.APP_NAME }}/krankerl.toml
131+
132+
- name: Install Krankerl
133+
if: steps.krankerl.outputs.files_exists == 'true'
134+
run: |
135+
wget https://github.com/ChristophWurst/krankerl/releases/download/v0.14.0/krankerl_0.14.0_amd64.deb
136+
sudo dpkg -i krankerl_0.14.0_amd64.deb
137+
138+
- name: Package ${{ env.APP_NAME }} ${{ env.APP_VERSION }} with krankerl
139+
if: steps.krankerl.outputs.files_exists == 'true'
140+
run: |
141+
cd ${{ env.APP_NAME }}
142+
krankerl package
143+
144+
- name: Package ${{ env.APP_NAME }} ${{ env.APP_VERSION }} with makefile
145+
if: steps.krankerl.outputs.files_exists != 'true'
146+
run: |
147+
cd ${{ env.APP_NAME }}
148+
make appstore
149+
150+
- name: Checkout server ${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}
151+
continue-on-error: true
152+
id: server-checkout
153+
run: |
154+
NCVERSION='${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}'
155+
wget --quiet https://download.nextcloud.com/server/releases/latest-$NCVERSION.zip
156+
unzip latest-$NCVERSION.zip
157+
158+
- name: Checkout server master fallback
159+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
160+
if: ${{ steps.server-checkout.outcome != 'success' }}
161+
with:
162+
persist-credentials: false
163+
submodules: true
164+
repository: nextcloud/server
165+
path: nextcloud
166+
167+
- name: Sign app
168+
run: |
169+
# Extracting release
170+
cd ${{ env.APP_NAME }}/build/artifacts
171+
tar -xvf ${{ env.APP_NAME }}.tar.gz
172+
cd ../../../
173+
# Setting up keys
174+
echo '${{ secrets.APP_PRIVATE_KEY }}' > ${{ env.APP_NAME }}.key
175+
wget --quiet "https://github.com/nextcloud/app-certificate-requests/raw/master/${{ env.APP_NAME }}/${{ env.APP_NAME }}.crt"
176+
# Signing
177+
php nextcloud/occ integrity:sign-app --privateKey=../${{ env.APP_NAME }}.key --certificate=../${{ env.APP_NAME }}.crt --path=../${{ env.APP_NAME }}/build/artifacts/${{ env.APP_NAME }}
178+
# Rebuilding archive
179+
cd ${{ env.APP_NAME }}/build/artifacts
180+
tar -zcvf ${{ env.APP_NAME }}.tar.gz ${{ env.APP_NAME }}
181+
182+
- name: Attach tarball to github release
183+
uses: svenstaro/upload-release-action@81c65b7cd4de9b2570615ce3aad67a41de5b1a13 # v2.11.2
184+
id: attach_to_release
185+
with:
186+
repo_token: ${{ secrets.GITHUB_TOKEN }}
187+
file: ${{ env.APP_NAME }}/build/artifacts/${{ env.APP_NAME }}.tar.gz
188+
asset_name: ${{ env.APP_NAME }}-${{ env.APP_VERSION }}.tar.gz
189+
tag: ${{ github.ref }}
190+
overwrite: true
191+
192+
- name: Upload app to Nextcloud appstore
193+
uses: nextcloud-releases/nextcloud-appstore-push-action@a011fe619bcf6e77ddebc96f9908e1af4071b9c1 # v1.0.3
194+
with:
195+
app_name: ${{ env.APP_NAME }}
196+
appstore_token: ${{ secrets.APPSTORE_TOKEN }}
197+
download_url: ${{ steps.attach_to_release.outputs.browser_download_url }}
198+
app_private_key: ${{ secrets.APP_PRIVATE_KEY }}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
diff --git a/.github/workflows/appstore-build-publish.yml b/.github/workflows/appstore-build-publish.yml
2+
index 316ba14..3cb9983 100644
3+
--- a/.github/workflows/appstore-build-publish.yml
4+
+++ b/.github/workflows/appstore-build-publish.yml
5+
@@ -23,6 +23,12 @@ jobs:
6+
if: ${{ github.repository_owner == 'nextcloud-releases' }}
7+
8+
steps:
9+
+ - uses: cachix/install-nix-action@fc6e360bedc9ee72d75e701397f0bb30dce77568 # v31.5.2
10+
+ - uses: cachix/cachix-action@0fc020193b5a1fa3ac4575aa3a7d3aa6a35435ad # v16
11+
+ with:
12+
+ name: notify-push
13+
+ authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
14+
+
15+
- name: Check actor permission
16+
uses: skjnldsv/check-actor-permission@69e92a3c4711150929bca9fcf34448c5bf5526e7 # v3.0
17+
with:
18+
@@ -39,6 +45,7 @@ jobs:
19+
with:
20+
persist-credentials: false
21+
path: ${{ env.APP_NAME }}
22+
+ fetch-depth: 0
23+
24+
- name: Get app version number
25+
id: app-version
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
2+
SPDX-License-Identifier: MIT
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# This workflow is provided via the organization template repository
2+
#
3+
# https://github.com/nextcloud/.github
4+
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
5+
#
6+
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
7+
# SPDX-License-Identifier: MIT
8+
9+
name: Lint info.xml
10+
11+
on: pull_request
12+
13+
permissions:
14+
contents: read
15+
16+
concurrency:
17+
group: lint-info-xml-${{ github.head_ref || github.run_id }}
18+
cancel-in-progress: true
19+
20+
jobs:
21+
xml-linters:
22+
runs-on: ubuntu-latest-low
23+
24+
name: info.xml lint
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
28+
with:
29+
persist-credentials: false
30+
31+
- name: Download schema
32+
run: wget https://raw.githubusercontent.com/nextcloud/appstore/master/nextcloudappstore/api/v1/release/info.xsd
33+
34+
- name: Lint info.xml
35+
uses: ChristophWurst/xmllint-action@36f2a302f84f8c83fceea0b9c59e1eb4a616d3c1 # v1.2
36+
with:
37+
xml-file: ./appinfo/info.xml
38+
xml-schema-file: ./info.xsd
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# This workflow is provided via the organization template repository
2+
#
3+
# https://github.com/nextcloud/.github
4+
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
5+
#
6+
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
7+
# SPDX-License-Identifier: MIT
8+
9+
name: Lint php-cs
10+
11+
on: pull_request
12+
13+
permissions:
14+
contents: read
15+
16+
concurrency:
17+
group: lint-php-cs-${{ github.head_ref || github.run_id }}
18+
cancel-in-progress: true
19+
20+
jobs:
21+
lint:
22+
runs-on: ubuntu-latest
23+
24+
name: php-cs
25+
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
29+
with:
30+
persist-credentials: false
31+
32+
- name: Get php version
33+
id: versions
34+
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
35+
36+
- name: Set up php${{ steps.versions.outputs.php-min }}
37+
uses: shivammathur/setup-php@ccf2c627fe61b1b4d924adfcbd19d661a18133a0 # v2.35.2
38+
with:
39+
php-version: ${{ steps.versions.outputs.php-min }}
40+
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
41+
coverage: none
42+
ini-file: development
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
46+
- name: Install dependencies
47+
run: |
48+
composer remove nextcloud/ocp --dev --no-scripts
49+
composer i
50+
51+
- name: Lint
52+
run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 )

0 commit comments

Comments
 (0)