Skip to content

Commit ff35ee8

Browse files
authored
Initial commit
0 parents  commit ff35ee8

21 files changed

+778
-0
lines changed

.github/CODE_OF_CONDUCT.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Code of Conduct
2+
3+
Be openness, as well as friendly and didactic in discussions.
4+
5+
Treat everybody equally, and value their contributions.
6+
7+
Decisions are made based on technical merit and consensus.
8+
9+
Try to follow most principles described here: https://nextcloud.com/code-of-conduct/

.github/renovate.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": [
4+
"config:base",
5+
":disableDependencyDashboard"
6+
],
7+
"ignorePaths": [
8+
"**/docker/**",
9+
"**/docs/**",
10+
"**/tests/**",
11+
"Dockerfile"
12+
]
13+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Analysis & Coverage
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
permissions:
9+
contents: read
10+
11+
concurrency:
12+
group: ana_cov-${{ github.head_ref || github.run_id }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
analysis:
17+
runs-on: ubuntu-22.04
18+
name: Analysis
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: actions/setup-python@v5
23+
with:
24+
python-version: "3.10"
25+
26+
- name: Install from source
27+
run: |
28+
python3 -m pip install -r requirements.txt
29+
30+
- name: Run Analysis
31+
run: |
32+
python3 -m pip install pylint
33+
python3 -m pylint "lib/"
Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
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+
name: Build and publish app release
7+
8+
on:
9+
release:
10+
types: [published]
11+
12+
env:
13+
PHP_VERSION: 8.1
14+
15+
jobs:
16+
build_and_publish:
17+
runs-on: ubuntu-latest
18+
19+
# Only allowed to be run on nextcloud-releases repositories
20+
if: ${{ github.repository_owner == 'cloud-py-api' }} # REPLACE THIS WITH YOUR ORGANIZATION NAME
21+
22+
steps:
23+
- name: Check actor permission
24+
uses: skjnldsv/check-actor-permission@e591dbfe838300c007028e1219ca82cc26e8d7c5 # v2.1
25+
with:
26+
require: write
27+
28+
- name: Set app env
29+
run: |
30+
# Split and keep last
31+
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
32+
echo "APP_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
33+
34+
- name: Checkout
35+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
36+
with:
37+
path: ${{ env.APP_NAME }}
38+
39+
- name: Get appinfo data
40+
id: appinfo
41+
uses: skjnldsv/xpath-action@7e6a7c379d0e9abc8acaef43df403ab4fc4f770c # master
42+
with:
43+
filename: ${{ env.APP_NAME }}/appinfo/info.xml
44+
expression: "//info//dependencies//nextcloud/@min-version"
45+
46+
- name: Read package.json node and npm engines version
47+
uses: skjnldsv/read-package-engines-version-actions@1bdcee71fa343c46b18dc6aceffb4cd1e35209c6 # v1.2
48+
id: versions
49+
# Continue if no package.json
50+
continue-on-error: true
51+
with:
52+
path: ${{ env.APP_NAME }}
53+
fallbackNode: "^20"
54+
fallbackNpm: "^8"
55+
56+
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
57+
# Skip if no package.json
58+
if: ${{ steps.versions.outputs.nodeVersion }}
59+
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3
60+
with:
61+
node-version: ${{ steps.versions.outputs.nodeVersion }}
62+
63+
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
64+
# Skip if no package.json
65+
if: ${{ steps.versions.outputs.npmVersion }}
66+
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
67+
68+
- name: Set up php ${{ env.PHP_VERSION }}
69+
uses: shivammathur/setup-php@1a18b2267f80291a81ca1d33e7c851fe09e7dfc4 # v2
70+
with:
71+
php-version: ${{ env.PHP_VERSION }}
72+
coverage: none
73+
env:
74+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75+
76+
- name: Check composer.json
77+
id: check_composer
78+
uses: andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b # v2
79+
with:
80+
files: "${{ env.APP_NAME }}/composer.json"
81+
82+
- name: Install composer dependencies
83+
if: steps.check_composer.outputs.files_exists == 'true'
84+
run: |
85+
cd ${{ env.APP_NAME }}
86+
composer install --no-dev
87+
88+
- name: Build ${{ env.APP_NAME }}
89+
# Skip if no package.json
90+
if: ${{ steps.versions.outputs.nodeVersion }}
91+
run: |
92+
cd ${{ env.APP_NAME }}
93+
npm ci
94+
npm run build
95+
96+
- name: Check Krankerl config
97+
id: krankerl
98+
uses: andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b # v2
99+
with:
100+
files: ${{ env.APP_NAME }}/krankerl.toml
101+
102+
- name: Install Krankerl
103+
if: steps.krankerl.outputs.files_exists == 'true'
104+
run: |
105+
wget https://github.com/ChristophWurst/krankerl/releases/download/v0.14.0/krankerl_0.14.0_amd64.deb
106+
sudo dpkg -i krankerl_0.14.0_amd64.deb
107+
108+
- name: Package ${{ env.APP_NAME }} ${{ env.APP_VERSION }} with krankerl
109+
if: steps.krankerl.outputs.files_exists == 'true'
110+
run: |
111+
cd ${{ env.APP_NAME }}
112+
krankerl package
113+
114+
- name: Package ${{ env.APP_NAME }} ${{ env.APP_VERSION }} with makefile
115+
if: steps.krankerl.outputs.files_exists != 'true'
116+
run: |
117+
cd ${{ env.APP_NAME }}
118+
make appstore
119+
120+
- name: Checkout server ${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}
121+
continue-on-error: true
122+
id: server-checkout
123+
run: |
124+
NCVERSION=${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}
125+
wget --quiet https://download.nextcloud.com/server/releases/latest-$NCVERSION.zip
126+
unzip latest-$NCVERSION.zip
127+
128+
- name: Checkout server master fallback
129+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
130+
if: ${{ steps.server-checkout.outcome != 'success' }}
131+
with:
132+
submodules: true
133+
repository: nextcloud/server
134+
path: nextcloud
135+
136+
- name: Sign app
137+
run: |
138+
# Extracting release
139+
cd ${{ env.APP_NAME }}/build/artifacts
140+
tar -xvf ${{ env.APP_NAME }}.tar.gz
141+
cd ../../../
142+
# Setting up keys
143+
echo "${{ secrets.APP_PRIVATE_KEY }}" > ${{ env.APP_NAME }}.key
144+
wget --quiet "https://github.com/nextcloud/app-certificate-requests/raw/master/${{ env.APP_NAME }}/${{ env.APP_NAME }}.crt"
145+
# Signing
146+
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 }}
147+
# Rebuilding archive
148+
cd ${{ env.APP_NAME }}/build/artifacts
149+
tar -zcvf ${{ env.APP_NAME }}.tar.gz ${{ env.APP_NAME }}
150+
151+
- name: Attach tarball to github release
152+
uses: svenstaro/upload-release-action@133984371c30d34e38222a64855679a414cb7575 # v2
153+
id: attach_to_release
154+
with:
155+
repo_token: ${{ secrets.GITHUB_TOKEN }}
156+
file: ${{ env.APP_NAME }}/build/artifacts/${{ env.APP_NAME }}.tar.gz
157+
asset_name: ${{ env.APP_NAME }}-${{ env.APP_VERSION }}.tar.gz
158+
tag: ${{ github.ref }}
159+
overwrite: true
160+
161+
- name: Upload app to Nextcloud appstore
162+
uses: nextcloud-releases/nextcloud-appstore-push-action@a011fe619bcf6e77ddebc96f9908e1af4071b9c1 # v1
163+
with:
164+
app_name: ${{ env.APP_NAME }}
165+
appstore_token: ${{ secrets.APPSTORE_TOKEN }}
166+
download_url: ${{ steps.attach_to_release.outputs.browser_download_url }}
167+
app_private_key: ${{ secrets.APP_PRIVATE_KEY }}

.github/workflows/stale.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: 'Close stale issues'
2+
3+
on:
4+
schedule:
5+
- cron: '0 12 * * 0' # Every Sunday at 12:00 PM UTC
6+
7+
jobs:
8+
stale:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/stale@v9
12+
with:
13+
days-before-stale: 14
14+
days-before-close: 9
15+
days-before-pr-close: -1 # Never close PR's automatically
16+
any-of-labels: 'question, invalid'
17+
stale-issue-message: 'This issue did not receive an update in the last 4 weeks.
18+
Please take a look again and update the issue with new details,
19+
otherwise it will be automatically closed in 2 weeks. Thank you!'
20+
exempt-all-pr-milestones: true

.gitignore

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
.DS_Store
2+
node_modules/
3+
npm-debug.log*
4+
yarn-debug.log*
5+
yarn-error.log*
6+
7+
# Editor directories and files
8+
.idea
9+
.vscode
10+
*.suo
11+
*.ntvs*
12+
*.njsproj
13+
*.sln
14+
15+
.marginalia
16+
17+
/js/
18+
build/
19+
coverage/
20+
vendor
21+
.php-cs-fixer.cache
22+
.phpunit.result.cache
23+
24+
/out
25+
/dev/
26+
local
27+
tmp
28+
.phpdoc
29+
clover.unit.xml
30+
clover.integration.xml
31+
proto/thrift/gen-*
32+
33+
# Python Part
34+
35+
# Byte-compiled / optimized / DLL files
36+
__pycache__/
37+
*.py[cod]
38+
*$py.class
39+
40+
# Pycharm settings
41+
.idea/
42+
43+
# mypy
44+
.mypy_cache/
45+
.dmypy.json
46+
dmypy.json
47+
48+
# Pyre type checker
49+
.pyre/
50+
51+
# pytype static type analyzer
52+
.pytype/
53+
54+
# Environments
55+
.env
56+
.venv
57+
env/
58+
venv/
59+
ENV/
60+
env.bak/
61+
venv.bak/
62+
63+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
64+
__pypackages__/
65+
66+
# Scrapy stuff:
67+
.scrapy
68+
69+
# Sphinx documentation
70+
docs/_build/
71+
72+
# PyBuilder
73+
.pybuilder/
74+
target/
75+
76+
# Distribution / packaging
77+
.Python
78+
develop-eggs/
79+
dist/
80+
downloads/
81+
eggs/
82+
.eggs/
83+
lib64/
84+
parts/
85+
sdist/
86+
var/
87+
wheels/
88+
share/python-wheels/
89+
*.egg-info/
90+
.installed.cfg
91+
*.egg
92+
MANIFEST
93+
converted/
94+
95+
geckodriver.log

.nextcloudignore

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
.git
2+
.github
3+
.gitignore
4+
.tx
5+
.vscode
6+
.php-cs-fixer.*
7+
/.codecov.yml
8+
/.eslintrc.js
9+
/.gitattributes
10+
/.gitignore
11+
/.l10nignore
12+
/.nextcloudignore
13+
/.travis.yml
14+
/.pre-commit-config.yaml
15+
/.run
16+
/babel.config.js
17+
/build
18+
/APPS.md
19+
/AUTHORS.md
20+
/CHANGELOG.md
21+
/HOW_TO_INSTALL.md
22+
/README.md
23+
/composer.*
24+
/node_modules
25+
/screenshots
26+
/examples
27+
/docs
28+
/src
29+
/vendor/bin
30+
/jest.config.js
31+
/Makefile
32+
/krankerl.toml
33+
/package-lock.json
34+
/package.json
35+
/postcss.config.js
36+
/psalm.xml
37+
/pyproject.toml
38+
/renovate.json
39+
/stylelint.config.js
40+
/webpack.*
41+
/requirements.txt
42+
/Dockerfile
43+
/results
44+
tests

0 commit comments

Comments
 (0)