Skip to content

Commit 55a63f1

Browse files
authored
Merge branch 'main' into feat/Dockerfile/switch-cmd-to-entrypoint
Signed-off-by: Joda Stößer <services+github@simjo.st>
2 parents baace31 + dcc4514 commit 55a63f1

58 files changed

Lines changed: 5738 additions & 2628 deletions

Some content is hidden

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

.github/dependabot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: cargo
4+
directory: "/"
5+
schedule:
6+
interval: weekly
7+
day: tuesday
8+
time: "02:00"
9+
open-pull-requests-limit: 10
Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
# This workflow is adjusted compared to the one from the template to setup rust+cross
2+
3+
name: Build and publish app release
4+
5+
on:
6+
release:
7+
types: [published]
8+
9+
env:
10+
PHP_VERSION: 8.1
11+
12+
jobs:
13+
build_and_publish:
14+
runs-on: ubuntu-latest
15+
16+
# Only allowed to be run on nextcloud-releases repositories
17+
if: ${{ github.repository_owner == 'nextcloud-releases' }}
18+
19+
steps:
20+
### Adjustments start ###
21+
- name: musl-tools
22+
run: |
23+
sudo apt-get install musl-tools
24+
- name: Checkout code
25+
uses: actions/checkout@v3
26+
- uses: actions-rs/toolchain@v1
27+
with:
28+
profile: minimal
29+
toolchain: stable
30+
override: true
31+
target: x86_64-unknown-linux-musl
32+
- name: cross
33+
run: |
34+
cargo install cross --locked
35+
### Adjustments end ###
36+
37+
- name: Check actor permission
38+
uses: skjnldsv/check-actor-permission@e591dbfe838300c007028e1219ca82cc26e8d7c5 # v2.1
39+
with:
40+
require: write
41+
42+
- name: Set app env
43+
run: |
44+
# Split and keep last
45+
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
46+
echo "APP_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
47+
48+
- name: Checkout
49+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
50+
with:
51+
path: ${{ env.APP_NAME }}
52+
53+
- name: Get appinfo data
54+
id: appinfo
55+
uses: skjnldsv/xpath-action@7e6a7c379d0e9abc8acaef43df403ab4fc4f770c # master
56+
with:
57+
filename: ${{ env.APP_NAME }}/appinfo/info.xml
58+
expression: "//info//dependencies//nextcloud/@min-version"
59+
60+
- name: Read package.json node and npm engines version
61+
uses: skjnldsv/read-package-engines-version-actions@0ce2ed60f6df073a62a77c0a4958dd0fc68e32e7 # v2.1
62+
id: versions
63+
# Continue if no package.json
64+
continue-on-error: true
65+
with:
66+
path: ${{ env.APP_NAME }}
67+
fallbackNode: "^16"
68+
fallbackNpm: "^7"
69+
70+
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
71+
# Skip if no package.json
72+
if: ${{ steps.versions.outputs.nodeVersion }}
73+
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
74+
with:
75+
node-version: ${{ steps.versions.outputs.nodeVersion }}
76+
77+
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
78+
# Skip if no package.json
79+
if: ${{ steps.versions.outputs.npmVersion }}
80+
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
81+
82+
- name: Set up php ${{ env.PHP_VERSION }}
83+
uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2
84+
with:
85+
php-version: ${{ env.PHP_VERSION }}
86+
coverage: none
87+
env:
88+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89+
90+
- name: Check composer.json
91+
id: check_composer
92+
uses: andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b # v2
93+
with:
94+
files: "${{ env.APP_NAME }}/composer.json"
95+
96+
- name: Install composer dependencies
97+
if: steps.check_composer.outputs.files_exists == 'true'
98+
run: |
99+
cd ${{ env.APP_NAME }}
100+
composer install --no-dev
101+
102+
- name: Build ${{ env.APP_NAME }}
103+
# Skip if no package.json
104+
if: ${{ steps.versions.outputs.nodeVersion }}
105+
run: |
106+
cd ${{ env.APP_NAME }}
107+
npm ci
108+
npm run build
109+
110+
- name: Check Krankerl config
111+
id: krankerl
112+
uses: andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b # v2
113+
with:
114+
files: ${{ env.APP_NAME }}/krankerl.toml
115+
116+
- name: Install Krankerl
117+
if: steps.krankerl.outputs.files_exists == 'true'
118+
run: |
119+
wget https://github.com/ChristophWurst/krankerl/releases/download/v0.14.0/krankerl_0.14.0_amd64.deb
120+
sudo dpkg -i krankerl_0.14.0_amd64.deb
121+
122+
- name: Package ${{ env.APP_NAME }} ${{ env.APP_VERSION }} with krankerl
123+
if: steps.krankerl.outputs.files_exists == 'true'
124+
run: |
125+
cd ${{ env.APP_NAME }}
126+
krankerl package
127+
128+
- name: Package ${{ env.APP_NAME }} ${{ env.APP_VERSION }} with makefile
129+
if: steps.krankerl.outputs.files_exists != 'true'
130+
run: |
131+
cd ${{ env.APP_NAME }}
132+
make appstore
133+
134+
- name: Checkout server ${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}
135+
continue-on-error: true
136+
id: server-checkout
137+
run: |
138+
NCVERSION=${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}
139+
wget --quiet https://download.nextcloud.com/server/releases/latest-$NCVERSION.zip
140+
unzip latest-$NCVERSION.zip
141+
142+
- name: Checkout server master fallback
143+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
144+
if: ${{ steps.server-checkout.outcome != 'success' }}
145+
with:
146+
submodules: true
147+
repository: nextcloud/server
148+
path: nextcloud
149+
150+
- name: Sign app
151+
run: |
152+
# Extracting release
153+
cd ${{ env.APP_NAME }}/build/artifacts
154+
tar -xvf ${{ env.APP_NAME }}.tar.gz
155+
cd ../../../
156+
# Setting up keys
157+
echo "${{ secrets.APP_PRIVATE_KEY }}" > ${{ env.APP_NAME }}.key
158+
wget --quiet "https://github.com/nextcloud/app-certificate-requests/raw/master/${{ env.APP_NAME }}/${{ env.APP_NAME }}.crt"
159+
# Signing
160+
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 }}
161+
# Rebuilding archive
162+
cd ${{ env.APP_NAME }}/build/artifacts
163+
tar -zcvf ${{ env.APP_NAME }}.tar.gz ${{ env.APP_NAME }}
164+
165+
- name: Attach tarball to github release
166+
uses: svenstaro/upload-release-action@2b9d2847a97b04d02ad5c3df2d3a27baa97ce689 # v2
167+
id: attach_to_release
168+
with:
169+
repo_token: ${{ secrets.GITHUB_TOKEN }}
170+
file: ${{ env.APP_NAME }}/build/artifacts/${{ env.APP_NAME }}.tar.gz
171+
asset_name: ${{ env.APP_NAME }}-${{ env.APP_VERSION }}.tar.gz
172+
tag: ${{ github.ref }}
173+
overwrite: true
174+
175+
- name: Upload app to Nextcloud appstore
176+
uses: nextcloud-releases/nextcloud-appstore-push-action@a011fe619bcf6e77ddebc96f9908e1af4071b9c1 # v1
177+
with:
178+
app_name: ${{ env.APP_NAME }}
179+
appstore_token: ${{ secrets.APPSTORE_TOKEN }}
180+
download_url: ${{ steps.attach_to_release.outputs.browser_download_url }}
181+
app_private_key: ${{ secrets.APP_PRIVATE_KEY }}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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: Lint info.xml
7+
8+
on:
9+
pull_request:
10+
push:
11+
branches:
12+
- main
13+
- master
14+
- stable*
15+
16+
permissions:
17+
contents: read
18+
19+
concurrency:
20+
group: lint-info-xml-${{ github.head_ref || github.run_id }}
21+
cancel-in-progress: true
22+
23+
jobs:
24+
xml-linters:
25+
runs-on: ubuntu-latest
26+
27+
name: info.xml lint
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
31+
32+
- name: Download schema
33+
run: wget https://raw.githubusercontent.com/nextcloud/appstore/master/nextcloudappstore/api/v1/release/info.xsd
34+
35+
- name: Lint info.xml
36+
uses: ChristophWurst/xmllint-action@39155a91429af431d65fafc21fa52ba5c4f5cb71 # v1.1
37+
with:
38+
xml-file: ./appinfo/info.xml
39+
xml-schema-file: ./info.xsd

.github/workflows/lint-php-cs.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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: Lint php-cs
7+
8+
on: pull_request
9+
10+
permissions:
11+
contents: read
12+
13+
concurrency:
14+
group: lint-php-cs-${{ github.head_ref || github.run_id }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
lint:
19+
runs-on: ubuntu-latest
20+
21+
name: php-cs
22+
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
26+
27+
- name: Set up php
28+
uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2
29+
with:
30+
php-version: 8.1
31+
coverage: none
32+
ini-file: development
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
36+
- name: Install dependencies
37+
run: composer i
38+
39+
- name: Lint
40+
run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 )

.github/workflows/lint-php.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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: Lint php
7+
8+
on:
9+
pull_request:
10+
push:
11+
branches:
12+
- main
13+
- master
14+
- stable*
15+
16+
permissions:
17+
contents: read
18+
19+
concurrency:
20+
group: lint-php-${{ github.head_ref || github.run_id }}
21+
cancel-in-progress: true
22+
23+
jobs:
24+
php-lint:
25+
runs-on: ubuntu-latest
26+
strategy:
27+
matrix:
28+
php-versions: [ "8.0", "8.1", "8.2" ]
29+
30+
name: php-lint
31+
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
35+
36+
- name: Set up php ${{ matrix.php-versions }}
37+
uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2
38+
with:
39+
php-version: ${{ matrix.php-versions }}
40+
coverage: none
41+
ini-file: development
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
45+
- name: Lint
46+
run: composer run lint
47+
48+
summary:
49+
permissions:
50+
contents: none
51+
runs-on: ubuntu-latest
52+
needs: php-lint
53+
54+
if: always()
55+
56+
name: php-lint-summary
57+
58+
steps:
59+
- name: Summary status
60+
run: if ${{ needs.php-lint.result != 'success' && needs.php-lint.result != 'skipped' }}; then exit 1; fi

.github/workflows/lint.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)