Skip to content

Commit

Permalink
Merge pull request #3250 from LibreSign/fix/sign-setup-when-build
Browse files Browse the repository at this point in the history
fix: sign setup when build
  • Loading branch information
vitormattos authored Jul 1, 2024
2 parents e951791 + dec3e86 commit 828a83f
Show file tree
Hide file tree
Showing 21 changed files with 60 additions and 638 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/phpunit-mariadb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ jobs:
php-versions: ${{ fromJson(needs.matrix.outputs.php-version) }}
server-versions: ${{ fromJson(needs.matrix.outputs.server-max) }}
mariadb-versions: ['10.6', '10.11']
testsuite: [unit, api]

name: MariaDB ${{ matrix.mariadb-versions }} PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }}

Expand Down Expand Up @@ -161,7 +160,7 @@ jobs:
# Only run if phpunit config file exists
if: steps.check_phpunit.outcome == 'success'
working-directory: apps/${{ env.APP_NAME }}
run: php vendor/bin/phpunit --colors=always --testsuite=${{ matrix.testsuite }}
run: composer run test:unit

- name: Check PHPUnit integration script is defined
id: check_integration
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/phpunit-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,8 @@ jobs:
php-versions: ${{ fromJson(needs.matrix.outputs.php-version) }}
server-versions: ${{ fromJson(needs.matrix.outputs.server-max) }}
mysql-versions: ["8.4"]
testsuite: [unit, api]

name: MySQL ${{ matrix.mysql-versions }} PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }} Testsuite ${{ matrix.testsuite }}
name: MySQL ${{ matrix.mysql-versions }} PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }}

services:
mysql:
Expand Down Expand Up @@ -161,7 +160,7 @@ jobs:
# Only run if phpunit config file exists
if: steps.check_phpunit.outcome == 'success'
working-directory: apps/${{ env.APP_NAME }}
run: php vendor/bin/phpunit --colors=always --testsuite=${{ matrix.testsuite }}
run: composer run test:unit

- name: Check PHPUnit integration script is defined
id: check_integration
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/phpunit-pgsql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ jobs:
matrix:
php-versions: ${{ fromJson(needs.matrix.outputs.php-version) }}
server-versions: ${{ fromJson(needs.matrix.outputs.server-max) }}
testsuite: [unit, api]

name: PostgreSQL PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }}

Expand Down Expand Up @@ -157,7 +156,7 @@ jobs:
# Only run if phpunit config file exists
if: steps.check_phpunit.outcome == 'success'
working-directory: apps/${{ env.APP_NAME }}
run: php vendor/bin/phpunit --colors=always --testsuite=${{ matrix.testsuite }}
run: composer run test:unit

- name: Check PHPUnit integration script is defined
id: check_integration
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/phpunit-sqlite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,9 @@ jobs:
matrix:
php-versions: ${{ fromJson(needs.matrix.outputs.php-version) }}
server-versions: ${{ fromJson(needs.matrix.outputs.server-max) }}
testsuite: [unit, api]
xdebug_mode: [debug, coverage]

name: SQLite PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }} Testsuite ${{ matrix.testsuite }}
name: SQLite PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }}

steps:
- name: Set app env
Expand Down Expand Up @@ -149,7 +148,7 @@ jobs:
working-directory: apps/${{ env.APP_NAME }}
env:
XDEBUG_MODE: ${{ matrix.xdebug_mode }}
run: php vendor/bin/phpunit --colors=always --testsuite=${{ matrix.testsuite }}
run: composer run test:unit

- name: Check PHPUnit integration script is defined
id: check_integration
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ node_modules/
.phpunit.result.cache
*.phar
/src/__test__/coverage
/appinfo/install-*.json
29 changes: 13 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ appstore_sign_dir=$(appstore_build_directory)/sign
cert_dir=$(build_tools_directory)/certificates
npm=$(shell which npm 2> /dev/null)
composer=$(shell which composer 2> /dev/null)
ifeq (,$(shell type occ))
occ="php ../../occ"
else
occ="occ"
endif

all: dev-setup build-js-production
serve: dev-setup watch-js
Expand Down Expand Up @@ -109,22 +104,24 @@ appstore:
mkdir -p $(appstore_sign_dir)/$(app_name)/tests/fixtures
cp tests/fixtures/small_valid.pdf $(appstore_sign_dir)/$(app_name)/tests/fixtures

@if [ -z "$$GITHUB_ACTION" ]; then \
chown -R www-data:www-data $(appstore_sign_dir)/$(app_name) ; \
fi

mkdir -p $(cert_dir)
@if [ ! -f $(cert_dir)/$(app_name).crt ]; then \
curl -o $(cert_dir)/$(app_name).crt \
"https://github.com/nextcloud/app-certificate-requests/raw/master/$(app_name)/$(app_name).crt"; \
@if [ -n "$$GITHUB_ACTION" ]; then \
echo '${{ secrets.APP_PRIVATE_KEY }}' > $(cert_dir)/$(app_name).key ; \
fi
@if [ -f $(cert_dir)/$(app_name).key ]; then \
$(occ) libresign:install --all --architecture aarch64; \
$(occ) libresign:install --all --architecture x86_64; \
$(occ) libresign:developer:sign-setup --privateKey=$(cert_dir)/$(app_name).key \
chown -R www-data:www-data $(project_directory) ; \
curl -o $(cert_dir)/$(app_name).crt \
"https://github.com/nextcloud/app-certificate-requests/raw/master/$(app_name)/$(app_name).crt"; \
php ../../occ libresign:install --all --architecture aarch64; \
php ../../occ libresign:install --all --architecture x86_64; \
echo "Signing setup files…"; \
php lib/Command/Developer/SignSetupApplication.php \
libresign:developer:sign-setup \
--privateKey=$(cert_dir)/$(app_name).key \
--certificate=$(cert_dir)/$(app_name).crt; \
cp -r appinfo $(appstore_sign_dir)/$(app_name); \
echo "Signing app files…"; \
$(occ) integrity:sign-app \
php ../../occ integrity:sign-app \
--privateKey=$(cert_dir)/$(app_name).key\
--certificate=$(cert_dir)/$(app_name).crt\
--path=$(appstore_sign_dir)/$(app_name); \
Expand Down
1 change: 0 additions & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ Developed with ❤️ by [LibreCode](https://librecode.coop). Help us transform
<command>OCA\Libresign\Command\Configure\Cfssl</command>
<command>OCA\Libresign\Command\Configure\OpenSsl</command>
<command>OCA\Libresign\Command\Developer\Reset</command>
<command>OCA\Libresign\Command\Developer\SignSetup</command>
<command>OCA\Libresign\Command\Install</command>
<command>OCA\Libresign\Command\Uninstall</command>
</commands>
Expand Down
8 changes: 0 additions & 8 deletions appinfo/install-aarch64-cfssl.json

This file was deleted.

Loading

0 comments on commit 828a83f

Please sign in to comment.