Skip to content

Commit

Permalink
test release action with a nightly
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
  • Loading branch information
Julien Veyssier committed Mar 22, 2021
1 parent 1a76b93 commit cab6ec0
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 17 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ jobs:
sed -i $'s|if (substr($fullPath, 0, strlen($root) + 1) === $root . \'/\')|if (is_string($root) and substr($fullPath, 0, strlen($root) + 1) === $root . \'/\')|g' ~/html/nextcloud/lib/autoloader.php
cp -r $GITHUB_WORKSPACE ~/html/nextcloud/apps/${APP_ID}
php ~/html/nextcloud/occ maintenance:install --database "sqlite" --admin-user "admin" --admin-pass "password"
php ~/html/nextcloud/occ app:enable ${APP_ID}
php ~/html/nextcloud/occ maintenance:mode --off
cd ~/html/nextcloud/apps/${APP_ID}
echo "###### make"
webserveruser=runner occ_dir=~/html/nextcloud make > /dev/null
php ~/html/nextcloud/occ app:enable ${APP_ID}
php ~/html/nextcloud/occ maintenance:mode --off
echo "###### make appstore"
tag=${{ steps.tag.outputs.currenttag }}
version=${tag/v/}
webserveruser=runner occ_dir=~/html/nextcloud version=$version make build_release
webserveruser=runner occ_dir=~/html/nextcloud version=$version make appstore
echo "##[set-output name=version;]$version"
env:
APP_CRT: ${{ secrets.APP_CRT }}
Expand Down
34 changes: 22 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ build_tools_directory=$(CURDIR)/build/tools
source_build_directory=$(CURDIR)/build/artifacts/source
source_package_name=$(source_build_directory)/$(app_name)
appstore_build_directory=$(CURDIR)/build/artifacts/appstore
appstore_package_name=$(appstore_build_directory)/$(app_name)
npm=$(shell which npm 2> /dev/null)
composer=$(shell which composer 2> /dev/null)

build_dir=/tmp/build
sign_dir=/tmp/sign
cert_dir=$(HOME)/.nextcloud/certificates
webserveruser ?= wwwrun
occ_dir ?= /srv/www/htdocs/server
Expand Down Expand Up @@ -142,8 +143,10 @@ source:
# Builds the source package for the app store, ignores php and js tests
.PHONY: appstore
appstore:
rm -rf $(appstore_build_directory)
mkdir -p $(appstore_build_directory)
rm -rf $(build_dir)
mkdir -p $(build_dir)
rm -rf $(sign_dir)
mkdir -p $(sign_dir)
rsync -a \
--exclude=.git \
--exclude=build \
Expand All @@ -161,22 +164,29 @@ appstore:
--exclude=js/bower.json \
--exclude=js/karma.* \
--exclude=js/protractor.* \
--exclude=babel.config.js \
--exclude=webpack.*.js \
--exclude=package.json \
--exclude=bower.json \
--exclude=karma.* \
--exclude=protractor\.* \
--exclude=translationfiles \
--exclude=.* \
--exclude=js/.* \
../$(app_name) $(appstore_build_directory)
# give the webserver user the right to create signature file
sudo chown $(webserveruser) $(appstore_package_name)/appinfo
sudo -u $(webserveruser) php $(occ_dir)/occ integrity:sign-app --privateKey=$(cert_dir)/$(app_name).key --certificate=$(cert_dir)/$(app_name).crt --path=$(appstore_package_name)/
sudo chown -R $(USER) $(appstore_package_name)/appinfo
tar -czf $(appstore_package_name)-$(app_version).tar.gz \
-C $(appstore_build_directory) $(app_name)
echo NEXTCLOUD------------------------------------------
openssl dgst -sha512 -sign $(cert_dir)/$(app_name).key $(appstore_package_name)-$(app_version).tar.gz | openssl base64
../$(app_name) $(sign_dir)
@if [ -f $(cert_dir)/$(app_name).key ]; then \
sudo chown $(webserveruser) $(sign_dir)/$(app_name)/appinfo ;\
sudo -u $(webserveruser) php $(occ_dir)/occ integrity:sign-app --privateKey=$(cert_dir)/$(app_name).key --certificate=$(cert_dir)/$(app_name).crt --path=$(sign_dir)/$(app_name)/ ;\
sudo chown -R $(USER) $(sign_dir)/$(app_name)/appinfo ;\
else \
echo "!!! WARNING signature key not found" ;\
fi
tar -czf $(build_dir)/$(app_name)-$(app_version).tar.gz \
-C $(sign_dir) $(app_name)
@if [ -f $(cert_dir)/$(app_name).key ]; then \
echo NEXTCLOUD------------------------------------------ ;\
openssl dgst -sha512 -sign $(cert_dir)/$(app_name).key $(build_dir)/$(app_name)-$(app_version).tar.gz | openssl base64 | tee /tmp/build/sign.txt ;\
fi

# Command for running JS and PHP tests. Works for package.json files in the js/
# and root directory. If phpunit is not installed systemwide, a copy is fetched
Expand Down
4 changes: 2 additions & 2 deletions appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
- **📱 Devices:** Lost your phone? Check the map!
- **〰 Tracks:** Load GPS tracks or past trips. Recording with [PhoneTrack](https://f-droid.org/en/packages/net.eneiluj.nextcloud.phonetrack/) or [OwnTracks](https://owntracks.org) is planned.
]]></description>
<version>0.1.8</version>
<version>0.1.9</version>
<licence>agpl</licence>
<author mail="eneiluj@posteo.net">Julien Veyssier</author>
<author mail="kontakt+github@arne.email">Arne Hamann</author>
Expand All @@ -33,7 +33,7 @@
<screenshot>https://raw.githubusercontent.com/nextcloud/maps/master/screenshots/screenshot3.png</screenshot>
<dependencies>
<lib>exif</lib>
<nextcloud min-version="20" max-version="21"/>
<nextcloud min-version="20" max-version="22"/>
</dependencies>
<repair-steps>
<install>
Expand Down

0 comments on commit cab6ec0

Please sign in to comment.