Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0048fb8

Browse files
authored
Merge pull request #9 from nextcloud/chore/prepare-shipping
chore/prepare shipping
2 parents 5a3cf40 + 1f3530c commit 0048fb8

8 files changed

Lines changed: 475 additions & 3 deletions

File tree

Lines changed: 235 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,235 @@
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: Compile Command
10+
on:
11+
issue_comment:
12+
types: [created]
13+
14+
permissions:
15+
contents: read
16+
17+
jobs:
18+
init:
19+
runs-on: ubuntu-latest-low
20+
21+
# On pull requests and if the comment starts with `/compile`
22+
if: github.event.issue.pull_request != '' && startsWith(github.event.comment.body, '/compile')
23+
24+
outputs:
25+
git_path: ${{ steps.git-path.outputs.path }}
26+
arg1: ${{ steps.command.outputs.arg1 }}
27+
arg2: ${{ steps.command.outputs.arg2 }}
28+
head_ref: ${{ steps.comment-branch.outputs.head_ref }}
29+
base_ref: ${{ steps.comment-branch.outputs.base_ref }}
30+
31+
steps:
32+
- name: Get repository from pull request comment
33+
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
34+
id: get-repository
35+
with:
36+
github-token: ${{secrets.GITHUB_TOKEN}}
37+
script: |
38+
const pull = await github.rest.pulls.get({
39+
owner: context.repo.owner,
40+
repo: context.repo.repo,
41+
pull_number: context.issue.number
42+
});
43+
44+
const repositoryName = pull.data.head?.repo?.full_name
45+
console.log(repositoryName)
46+
return repositoryName
47+
48+
- name: Disabled on forks
49+
if: ${{ fromJSON(steps.get-repository.outputs.result) != github.repository }}
50+
run: |
51+
echo 'Can not execute /compile on forks'
52+
exit 1
53+
54+
- name: Check actor permission
55+
uses: skjnldsv/check-actor-permission@69e92a3c4711150929bca9fcf34448c5bf5526e7 # v3.0
56+
with:
57+
require: write
58+
59+
- name: Add reaction on start
60+
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0
61+
with:
62+
token: ${{ secrets.COMMAND_BOT_PAT }}
63+
repository: ${{ github.event.repository.full_name }}
64+
comment-id: ${{ github.event.comment.id }}
65+
reactions: '+1'
66+
67+
- name: Parse command
68+
uses: skjnldsv/parse-command-comment@5c955203c52424151e6d0e58fb9de8a9f6a605a1 # v3.1
69+
id: command
70+
71+
# Init path depending on which command is run
72+
- name: Init path
73+
id: git-path
74+
run: |
75+
if ${{ startsWith(steps.command.outputs.arg1, '/') }}; then
76+
echo "path=${{steps.command.outputs.arg1}}" >> $GITHUB_OUTPUT
77+
else
78+
echo "path=${{steps.command.outputs.arg2}}" >> $GITHUB_OUTPUT
79+
fi
80+
81+
- name: Init branch
82+
uses: xt0rted/pull-request-comment-branch@e8b8daa837e8ea7331c0003c9c316a64c6d8b0b1 # v3.0.0
83+
id: comment-branch
84+
85+
- name: Add reaction on failure
86+
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0
87+
if: failure()
88+
with:
89+
token: ${{ secrets.COMMAND_BOT_PAT }}
90+
repository: ${{ github.event.repository.full_name }}
91+
comment-id: ${{ github.event.comment.id }}
92+
reactions: '-1'
93+
94+
process:
95+
runs-on: ubuntu-latest
96+
needs: init
97+
98+
steps:
99+
- name: Restore cached git repository
100+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
101+
with:
102+
path: .git
103+
key: git-repo
104+
105+
- name: Checkout ${{ needs.init.outputs.head_ref }}
106+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
107+
with:
108+
persist-credentials: false
109+
token: ${{ secrets.COMMAND_BOT_PAT }}
110+
fetch-depth: 0
111+
ref: ${{ needs.init.outputs.head_ref }}
112+
113+
- name: Setup git
114+
run: |
115+
git config --local user.email '[email protected]'
116+
git config --local user.name 'nextcloud-command'
117+
118+
- name: Read package.json node and npm engines version
119+
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
120+
id: package-engines-versions
121+
with:
122+
fallbackNode: '^24'
123+
fallbackNpm: '^11.3'
124+
125+
- name: Set up node ${{ steps.package-engines-versions.outputs.nodeVersion }}
126+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
127+
with:
128+
node-version: ${{ steps.package-engines-versions.outputs.nodeVersion }}
129+
cache: npm
130+
131+
- name: Set up npm ${{ steps.package-engines-versions.outputs.npmVersion }}
132+
run: npm i -g 'npm@${{ steps.package-engines-versions.outputs.npmVersion }}'
133+
134+
- name: Rebase to ${{ needs.init.outputs.base_ref }}
135+
if: ${{ contains(needs.init.outputs.arg1, 'rebase') }}
136+
env:
137+
BASE_REF: ${{ needs.init.outputs.base_ref }}
138+
run: |
139+
git fetch origin "${BASE_REF}:${BASE_REF}"
140+
141+
# Start the rebase
142+
git rebase "origin/${BASE_REF}" || {
143+
# Handle rebase conflicts in a loop
144+
while [ -d .git/rebase-merge ] || [ -d .git/rebase-apply ]; do
145+
echo "Handling rebase conflict..."
146+
147+
# Remove and checkout /dist and /js folders from the base branch
148+
if [ -d "dist" ]; then
149+
rm -rf dist
150+
git checkout "origin/${BASE_REF}" -- dist/ 2>/dev/null || echo "No dist folder in base branch"
151+
fi
152+
if [ -d "js" ]; then
153+
rm -rf js
154+
git checkout "origin/${BASE_REF}" -- js/ 2>/dev/null || echo "No js folder in base branch"
155+
fi
156+
157+
# Stage all changes
158+
git add .
159+
160+
# Check if there are any changes after resolving conflicts
161+
if git diff --cached --quiet; then
162+
echo "No changes after conflict resolution, skipping commit"
163+
git rebase --skip
164+
else
165+
echo "Changes found, continuing rebase without editing commit message"
166+
git -c core.editor=true rebase --continue
167+
fi
168+
169+
# Break if rebase is complete
170+
if [ ! -d .git/rebase-merge ] && [ ! -d .git/rebase-apply ]; then
171+
break
172+
fi
173+
done
174+
}
175+
176+
- name: Install dependencies & build
177+
env:
178+
CYPRESS_INSTALL_BINARY: 0
179+
PUPPETEER_SKIP_DOWNLOAD: true
180+
run: |
181+
npm ci
182+
npm run build --if-present
183+
184+
- name: Commit default
185+
if: ${{ !contains(needs.init.outputs.arg1, 'fixup') && !contains(needs.init.outputs.arg1, 'amend') }}
186+
env:
187+
GIT_PATH: ${{ needs.init.outputs.git_path }}
188+
run: |
189+
git add "${GITHUB_WORKSPACE}${GIT_PATH}"
190+
git commit --signoff -m 'chore(assets): Recompile assets'
191+
192+
- name: Commit fixup
193+
if: ${{ contains(needs.init.outputs.arg1, 'fixup') }}
194+
env:
195+
GIT_PATH: ${{ needs.init.outputs.git_path }}
196+
run: |
197+
git add "${GITHUB_WORKSPACE}${GIT_PATH}"
198+
git commit --fixup=HEAD --signoff
199+
200+
- name: Commit amend
201+
if: ${{ contains(needs.init.outputs.arg1, 'amend') }}
202+
env:
203+
GIT_PATH: ${{ needs.init.outputs.git_path }}
204+
run: |
205+
git add "${GITHUB_WORKSPACE}${GIT_PATH}"
206+
git commit --amend --no-edit --signoff
207+
# Remove any [skip ci] from the amended commit
208+
git commit --amend -m "$(git log -1 --format='%B' | sed '/\[skip ci\]/d')"
209+
210+
- name: Push normally
211+
if: ${{ !contains(needs.init.outputs.arg1, 'rebase') && !contains(needs.init.outputs.arg1, 'amend') }}
212+
env:
213+
HEAD_REF: ${{ needs.init.outputs.head_ref }}
214+
BOT_TOKEN: ${{ secrets.COMMAND_BOT_PAT }} # zizmor: ignore[secrets-outside-env]
215+
run: |
216+
git remote set-url origin "https://x-access-token:${BOT_TOKEN}@github.com/${{ github.repository }}.git"
217+
git push origin "$HEAD_REF"
218+
219+
- name: Force push
220+
if: ${{ contains(needs.init.outputs.arg1, 'rebase') || contains(needs.init.outputs.arg1, 'amend') }}
221+
env:
222+
HEAD_REF: ${{ needs.init.outputs.head_ref }}
223+
BOT_TOKEN: ${{ secrets.COMMAND_BOT_PAT }} # zizmor: ignore[secrets-outside-env]
224+
run: |
225+
git remote set-url origin "https://x-access-token:${BOT_TOKEN}@github.com/${{ github.repository }}.git"
226+
git push --force-with-lease origin "$HEAD_REF"
227+
228+
- name: Add reaction on failure
229+
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0
230+
if: failure()
231+
with:
232+
token: ${{ secrets.COMMAND_BOT_PAT }}
233+
repository: ${{ github.event.repository.full_name }}
234+
comment-id: ${{ github.event.comment.id }}
235+
reactions: '-1'

‎.gitignore‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,3 @@
88
/tests/.phpunit.cache
99

1010
/node_modules/
11-
/js/
12-
/css/

‎appinfo/info.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<category>office</category>
1313
<bugs>https://github.com/nextcloud/office</bugs>
1414
<dependencies>
15-
<nextcloud min-version="33" max-version="35"/>
15+
<nextcloud min-version="35" max-version="35"/>
1616
</dependencies>
1717
<navigations>
1818
<navigation>

‎css/main-ChrxhTd_.chunk.css‎

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎css/office-main.css‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/* extracted by css-entry-points-plugin */
2+
@import './main-ChrxhTd_.chunk.css';

‎js/office-main.mjs‎

Lines changed: 97 additions & 0 deletions
Large diffs are not rendered by default.

‎js/office-main.mjs.license‎

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
SPDX-License-Identifier: (MPL-2.0 OR Apache-2.0)
2+
SPDX-License-Identifier: AGPL-3.0-or-later
3+
SPDX-License-Identifier: Apache-2.0
4+
SPDX-License-Identifier: GPL-3.0-or-later
5+
SPDX-License-Identifier: ISC
6+
SPDX-License-Identifier: MIT
7+
SPDX-FileCopyrightText: Anthony Fu <https://github.com/antfu>
8+
SPDX-FileCopyrightText: Antoni Andre <[email protected]>
9+
SPDX-FileCopyrightText: Austin Andrews
10+
SPDX-FileCopyrightText: David Clark
11+
SPDX-FileCopyrightText: David Myers <[email protected]>
12+
SPDX-FileCopyrightText: Dr.-Ing. Mario Heiderich, Cure53 <[email protected]> (https://cure53.de/)
13+
SPDX-FileCopyrightText: Eduardo San Martin Morote
14+
SPDX-FileCopyrightText: Evan You
15+
SPDX-FileCopyrightText: GitHub Inc.
16+
SPDX-FileCopyrightText: Guillaume Chau <[email protected]>
17+
SPDX-FileCopyrightText: Matt Zabriskie
18+
SPDX-FileCopyrightText: Nextcloud GmbH and Nextcloud contributors
19+
SPDX-FileCopyrightText: Perry Mitchell <[email protected]>
20+
SPDX-FileCopyrightText: atomiks
21+
SPDX-FileCopyrightText: escape-html developers
22+
SPDX-FileCopyrightText: office developers
23+
24+
This file is generated from multiple sources. Included packages:
25+
- @floating-ui/core
26+
- version: 1.7.5
27+
- license: MIT
28+
- @floating-ui/dom
29+
- version: 1.1.1
30+
- license: MIT
31+
- @floating-ui/utils
32+
- version: 0.2.11
33+
- license: MIT
34+
- @mdi/js
35+
- version: 7.4.47
36+
- license: Apache-2.0
37+
- @nextcloud/auth
38+
- version: 2.6.0
39+
- license: GPL-3.0-or-later
40+
- @nextcloud/axios
41+
- version: 2.6.0
42+
- license: GPL-3.0-or-later
43+
- @nextcloud/browser-storage
44+
- version: 0.5.0
45+
- license: GPL-3.0-or-later
46+
- @nextcloud/capabilities
47+
- version: 1.2.1
48+
- license: GPL-3.0-or-later
49+
- @nextcloud/event-bus
50+
- version: 3.3.3
51+
- license: GPL-3.0-or-later
52+
- @nextcloud/files
53+
- version: 4.0.0
54+
- license: AGPL-3.0-or-later
55+
- @nextcloud/initial-state
56+
- version: 3.0.0
57+
- license: GPL-3.0-or-later
58+
- @nextcloud/l10n
59+
- version: 3.4.1
60+
- license: GPL-3.0-or-later
61+
- @nextcloud/logger
62+
- version: 3.0.3
63+
- license: GPL-3.0-or-later
64+
- @nextcloud/paths
65+
- version: 3.1.0
66+
- license: GPL-3.0-or-later
67+
- @nextcloud/router
68+
- version: 3.1.0
69+
- license: GPL-3.0-or-later
70+
- @nextcloud/sharing
71+
- version: 0.3.0
72+
- license: GPL-3.0-or-later
73+
- @nextcloud/vue
74+
- version: 9.8.0
75+
- license: AGPL-3.0-or-later
76+
- @vitejs/plugin-vue
77+
- version: 6.0.7
78+
- license: MIT
79+
- @vue/reactivity
80+
- version: 3.5.34
81+
- license: MIT
82+
- @vue/runtime-core
83+
- version: 3.5.34
84+
- license: MIT
85+
- @vue/runtime-dom
86+
- version: 3.5.34
87+
- license: MIT
88+
- @vue/shared
89+
- version: 3.5.34
90+
- license: MIT
91+
- @vueuse/core
92+
- version: 14.3.0
93+
- license: MIT
94+
- @vueuse/shared
95+
- version: 14.3.0
96+
- license: MIT
97+
- axios
98+
- version: 1.16.1
99+
- license: MIT
100+
- dompurify
101+
- version: 3.4.5
102+
- license: (MPL-2.0 OR Apache-2.0)
103+
- escape-html
104+
- version: 1.0.3
105+
- license: MIT
106+
- floating-vue
107+
- version: 5.2.2
108+
- license: MIT
109+
- focus-trap
110+
- version: 8.2.1
111+
- license: MIT
112+
- office
113+
- version: 1.0.0
114+
- license: AGPL-3.0-or-later
115+
- semver
116+
- version: 7.8.1
117+
- license: ISC
118+
- splitpanes
119+
- version: 4.0.4
120+
- license: MIT
121+
- tabbable
122+
- version: 6.4.0
123+
- license: MIT
124+
- vite
125+
- version: 7.3.3
126+
- license: MIT
127+
- vite-plugin-node-polyfills
128+
- version: 0.24.0
129+
- license: MIT
130+
- vue-router
131+
- version: 5.0.7
132+
- license: MIT
133+
- webdav
134+
- version: 5.10.0
135+
- license: MIT

‎js/office-main.mjs.map‎

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)