Skip to content

Commit

Permalink
Merge pull request #1285 from nextcloud/maintenance/prepare-nc25
Browse files Browse the repository at this point in the history
Update action scripts to prepare the NC 25 release
  • Loading branch information
christianlupus authored Oct 25, 2022
2 parents 05204e3 + 90f0c73 commit 08e7930
Show file tree
Hide file tree
Showing 14 changed files with 71 additions and 35 deletions.
2 changes: 2 additions & 0 deletions .github/actions/deploy/appinfo/info.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<version>%%VERSION%%</version>
<licence>agpl</licence>
<author mail="github@christian-wolf.click">Christian Wolf</author>
<author mail="info@sebastianfey.de">Sebastian Fey</author>
<author mail="mail@marcelrobitaille.me">Marcel Robitaille</author>
<author mail="mrzapp@users.noreply.github.com">Jeppe Zapp</author>
<namespace>Cookbook</namespace>
<category>organization</category>
Expand Down
5 changes: 2 additions & 3 deletions .github/actions/deploy/create-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fi

deploy_path='.github/actions/deploy'

stable_branch=stable
stable_branch=$(cat "$deploy_path/stable_name")
master_branch=master

major=$(cat "$deploy_path/major")
Expand Down Expand Up @@ -79,8 +79,7 @@ git merge --no-ff $stable_branch

git remote add tokenized "https://nextcloud-cookbook-bot:$BOT_TOKEN@github.com/nextcloud/cookbook.git"

git -c "http.https://github.com/.extraheader=" push tokenized $stable_branch
git -c "http.https://github.com/.extraheader=" push tokenized $master_branch
git -c "http.https://github.com/.extraheader=" push tokenized $stable_branch $master_branch
git push origin "v$version"

echo "::set-output name=version::$version"
1 change: 1 addition & 0 deletions .github/actions/deploy/stable_name
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
stable
2 changes: 1 addition & 1 deletion .github/actions/deploy/update-data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ if [ -n "$suffix" ]; then
version_arr="$version_arr, '-$suffix'"
fi
sed "/VERSION_TAG/s@[[].*[]]@[$version_arr]@" -i lib/Controller/UtilApiController.php
git add lib/Controller/MainController.php
git add lib/Controller/UtilApiController.php
1 change: 1 addition & 0 deletions .github/actions/run-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ runs:
if [ "${{ inputs.installUntested }}" = 'true' ]; then PARAM="$PARAM --install-untested"; fi &&
if [ "${{ inputs.runCodeChecker }}" = 'true' ]; then PARAM="$PARAM --run-code-checker"; fi &&
cd .github/actions/run-tests &&
sudo pip install -r requirements.txt &&
./run-locally.py
$PARAM
--pull
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-test-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ jobs:
shell: bash
id: check
run: |
echo "::set-output name=skip::false"
echo "skip=false" >> $GITHUB_OUTPUT
if [ -z "${{ secrets.DOCKER_HUB_TOKEN }}" ]; then
echo "::set-output name=skip::true"
echo "skip=true" >> $GITHUB_OUTPUT
fi
if [ -z "${{ secrets.DOCKER_HUB_USERNAME }}" ]; then
echo "::set-output name=skip::true"
echo "skip=true" >> $GITHUB_OUTPUT
fi
- name: Checkout the app
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/deploy-appstore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Deploy to Appstore
on:
push:
branches:
- stable
- stable*

jobs:

Expand All @@ -29,7 +29,7 @@ jobs:

- name: Get the date
id: date
run: echo "::set-output name=date::$(date +%Y-%m-%d)"
run: echo "date=$(date +%Y-%m-%d)" >> $GITHUB_OUTPUT
- name: Use cache for NPM
uses: actions/cache@v3.0.11
with:
Expand Down Expand Up @@ -120,7 +120,7 @@ jobs:
ret=$? &&
code=$(echo "$curl_out" | tail -n 1) &&
msg=$(echo "$curl_out" | head -n -1) &&
echo "::set-output name=code::$code" &&
echo "::set-output name=msg::$msg" &&
echo "code=$code" >> $GITHUB_OUTPUT &&
echo "msg=$msg" >> $GITHUB_OUTPUT &&
echo "Result ($code): $msg" &&
echo "$code" | grep '^\([^45][0-9][0-9]\)$'
2 changes: 1 addition & 1 deletion .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
run: |
count=$(find docs/ -name \*.puml | wc -l)
echo "There are $count plantuml files"
echo "::set-output name=num::$count"
echo "num=$count" >> $GITHUB_OUTPUT
- name: Install PlantUML on demand
if: steps.count-plantuml.outputs.num > 0
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pull-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
run: |
git diff HEAD~1 -- CHANGELOG.md
lines=$(git diff HEAD~1 -- CHANGELOG.md | wc -l)
echo "::set-output name=lines::$lines"
echo "lines=$lines" >> $GITHUB_OUTPUT
- name: Get all changed file names
id: file-names
Expand All @@ -31,7 +31,7 @@ jobs:
echo "$lines"
cnt="$(echo "$lines" | grep -v '^package-lock.json$' | wc -l)"
echo "That are $cnt changed files."
echo "::set-output name=num::$cnt"
echo "num=$cnt" >> $GITHUB_OUTPUT
- name: Error if the number of diff lines is zero
run: |
Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
fetch-depth: 1
- name: Get the date
id: date
run: echo "::set-output name=date::$(date +%Y-%m-%d)"
run: echo "date=$(date +%Y-%m-%d)" >> $GITHUB_OUTPUT
- name: Cache NPM cache
uses: actions/cache@v3.0.11
with:
Expand Down
66 changes: 47 additions & 19 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

- name: Get the date
id: date
run: echo "::set-output name=date::$(date +%Y-%m-%d)"
run: echo "date=$(date +%Y-%m-%d)" >> $GITHUB_OUTPUT
- name: Cache NPM cache
uses: actions/cache@v3.0.11
with:
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:

- name: Install Node packages
shell: bash
run: npm -q install || { cat ~/.npm/eresolve-report.txt ; exit 1; }
run: npm -q ci || { cat ~/.npm/eresolve-report.txt ; exit 1; }

- name: Run PHP linter
shell: bash
Expand Down Expand Up @@ -111,34 +111,35 @@ jobs:
database:
- mysql
coreVersion:
- stable21
- stable22
- stable23
- stable24
- 21
- 22
- 23
- 24
- 25
phpVersion:
- "8.0"
httpServer:
- "apache"
include:
# Test different databses
- database: sqlite
coreVersion: stable24
coreVersion: 25
phpVersion: "8.1"
httpServer: "apache"
- database: pgsql
coreVersion: stable24
coreVersion: 25
phpVersion: "8.1"
httpServer: "apache"

# Test different PHP versions additionally
- database: mysql
coreVersion: stable24
coreVersion: 25
phpVersion: "8.1"
httpServer: "apache"

# Test different HTTP server
- database: mysql
coreVersion: stable24
coreVersion: 25
phpVersion: "8.1"
httpServer: "nginx"

Expand All @@ -154,46 +155,73 @@ jobs:

#- name: Docker Layer Caching
#uses: satackey/action-docker-layer-caching@v0.0.8


- name: Install helper program
shell: bash
run: |-
pip install yq
- name: Get the min and max compatible server versions from manifest XML file
shell: bash
id: ncVersionRequirements
run: |-
minVersion="$(cat appinfo/info.xml | xq '.info.dependencies.nextcloud."@min-version"' -r)"
maxVersion="$(cat appinfo/info.xml | xq '.info.dependencies.nextcloud."@max-version"' -r)"
echo "minVersion=$minVersion" >> $GITHUB_OUTPUT
echo "maxVersion=$maxVersion" >> $GITHUB_OUTPUT
echo "Compatible NC server versions: [$minVersion, $maxVersion]"
if [ "${{ matrix.coreVersion }}" -ge "$minVersion" -a "${{ matrix.coreVersion }}" -le "$maxVersion" ]; then
mv="true"
else
mv="false"
echo "Skipping the main tests as this version is marked incompatible with the installed NC version." >> $GITHUB_STEP_SUMMARY
fi
echo "matchingVersion=$mv" >> $GITHUB_OUTPUT
echo "The app is compatible with the current NV core v${{ matrix.coreVersion }}: $mv"
- name: Run the tests in docker container
if: steps.ncVersionRequirements.outputs.matchingVersion == 'true'
uses: ./.github/actions/run-tests
with:
db: ${{ matrix.database }}
phpVersion: ${{ matrix.phpVersion }}
server: ${{ matrix.httpServer }}
coreVersion: ${{ matrix.coreVersion }}
coreVersion: stable${{ matrix.coreVersion }}

- name: Upload the log file as artifact
if: steps.ncVersionRequirements.outputs.matchingVersion == 'true' && always()
uses: actions/upload-artifact@v3
if: always()
with:
name: Nextcloud-logs (${{matrix.database}}, ${{matrix.coreVersion}}, ${{matrix.httpServer}}, ${{matrix.phpVersion}})
name: Nextcloud-logs (${{matrix.database}}, stable${{matrix.coreVersion}}, ${{matrix.httpServer}}, ${{matrix.phpVersion}})
path: .github/actions/run-tests/volumes/data/nextcloud.log

- name: Copy coverage-reports into non-link folder
if: steps.ncVersionRequirements.outputs.matchingVersion == 'true'
shell: bash
run: >-
mkdir /tmp/coverage &&
rsync -a .github/actions/run-tests/volumes/coverage/latest/ /tmp/coverage
- name: Upload the code coverage report for codecov as artifacts
if: steps.ncVersionRequirements.outputs.matchingVersion == 'true'
uses: actions/upload-artifact@v3
with:
name: Code coverage (XML) (${{matrix.database}}, ${{matrix.coreVersion}}, ${{matrix.httpServer}}, ${{matrix.phpVersion}})
name: Code coverage (XML) (${{matrix.database}}, stable${{matrix.coreVersion}}, ${{matrix.httpServer}}, ${{matrix.phpVersion}})
path: "/tmp/coverage/coverage.*.xml"

# - name: Upload the code coverage report (unit tests) as artifacts
# uses: actions/upload-artifact@v3
# with:
# name: Code coverage (HTML) (${{matrix.database}}, ${{matrix.coreVersion}}, ${{matrix.httpServer}}, ${{matrix.phpVersion}})
# name: Code coverage (HTML) (${{matrix.database}}, stable${{matrix.coreVersion}}, ${{matrix.httpServer}}, ${{matrix.phpVersion}})
# path: "/tmp/coverage"

- name: Upload the junit log file artifact as artifact
uses: actions/upload-artifact@v3
with:
name: Junit test log files (${{matrix.database}}, ${{matrix.coreVersion}}, ${{matrix.httpServer}}, ${{matrix.phpVersion}})
name: Junit test log files (${{matrix.database}}, stable${{matrix.coreVersion}}, ${{matrix.httpServer}}, ${{matrix.phpVersion}})
path: .github/actions/run-tests/volumes/coverage/junit*.xml
if: always()
if: steps.ncVersionRequirements.outputs.matchingVersion == 'true' && always()

unit-tests-master:
name: Run the tests against the master branch of the NC server
Expand Down Expand Up @@ -357,7 +385,7 @@ jobs:

- name: Get the date
id: date
run: echo "::set-output name=date::$(date +%Y-%m-%d)"
run: echo "date=$(date +%Y-%m-%d)" >> $GITHUB_OUTPUT
- name: Use cache for NPM
uses: actions/cache@v3.0.11
with:
Expand Down
1 change: 1 addition & 0 deletions .tx/backport
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
stable
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
[1273](https://github.com/nextcloud/cookbook/pull/1273)
[1274](https://github.com/nextcloud/cookbook/pull/1274)
[1277](https://github.com/nextcloud/cookbook/pull/1277)
- Prepare the GitHub action scripts to be compatible with the upcoming version split in version 0.10.0
[#1285](https://github.com/nextcloud/cookbook/pull/1285) @christianlupus

### Documentation
- Fix bad writing
Expand Down
2 changes: 2 additions & 0 deletions appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<version>0.9.15</version>
<licence>agpl</licence>
<author mail="github@christian-wolf.click">Christian Wolf</author>
<author mail="info@sebastianfey.de">Sebastian Fey</author>
<author mail="mail@marcelrobitaille.me">Marcel Robitaille</author>
<author mail="mrzapp@users.noreply.github.com">Jeppe Zapp</author>
<namespace>Cookbook</namespace>
<category>organization</category>
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/UtilApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function __construct($AppName, IRequest $request) {
*/
public function getApiVersion(): JSONResponse {
$response = [
'cookbook_version' => [0, 9, 14], /* VERSION_TAG do not change this line manually */
'cookbook_version' => [0, 9, 15], /* VERSION_TAG do not change this line manually */
'api_version' => [
'epoch' => 0,
'major' => 1,
Expand Down

0 comments on commit 08e7930

Please sign in to comment.