Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature publish app #100

Merged
merged 4 commits into from
Mar 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build and publish app release

on:
release:
types: [published]

env:
APP_NAME: libresign

jobs:
build_and_publish:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
path: ${{ env.APP_NAME }}
- name: Run build
run: cd ${{ env.APP_NAME }} && make appstore
- name: Upload app tarball to release
uses: svenstaro/upload-release-action@v2
id: attach_to_release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.APP_NAME }}/build/artifacts/appstore/${{ env.APP_NAME }}.tar.gz
asset_name: ${{ env.APP_NAME }}.tar.gz
tag: ${{ github.ref }}
overwrite: true
- name: Upload app to Nextcloud appstore
uses: R0Wi/nextcloud-appstore-push-action@v1
with:
app_name: ${{ env.APP_NAME }}
appstore_token: ${{ secrets.APPSTORE_TOKEN }}
download_url: ${{ steps.attach_to_release.outputs.browser_download_url }}
app_private_key: ${{ secrets.APP_PRIVATE_KEY }}
nightly: ${{ github.event.release.prerelease }}
46 changes: 34 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ project_directory=$(CURDIR)/../$(app_name)
build_tools_directory=$(CURDIR)/build/tools
appstore_build_directory=$(CURDIR)/build/artifacts/appstore
appstore_package_name=$(appstore_build_directory)/$(app_name)
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)

Expand Down Expand Up @@ -83,16 +85,36 @@ test: composer

# 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)
appstore: clean
mkdir -p $(appstore_sign_dir)/$(app_name)
composer install --no-dev
tar -cvzf $(appstore_package_name).tar.gz \
--exclude-vcs \
$(project_directory)/appinfo \
$(project_directory)/cfssl \
$(project_directory)/img \
$(project_directory)/js \
$(project_directory)/lib \
$(project_directory)/templates \
$(project_directory)/vendor
npm install --production
npm run build
cp -r \
appinfo \
cfssl \
img \
js \
l10n \
lib \
templates \
vendor \
CHANGELOG.md \
LICENSE \
$(appstore_sign_dir)/$(app_name)
chown -R www-data:www-data $(appstore_sign_dir)/$(app_name)

mkdir -p $(cert_dir)
@if [ -n "$$APP_PRIVATE_KEY" ]; then \
echo "$$APP_PRIVATE_KEY" > $(cert_dir)/$(app_name).key; \
echo "$$APP_PUBLIC_CRT" > $(cert_dir)/$(app_name).crt; \
echo "Signing app files…"; \
runuser -u www-data -- \
php ../../occ integrity:sign-app \
--privateKey=$(cert_dir)/$(app_name).key\
--certificate=$(cert_dir)/$(app_name).crt\
--path=$(appstore_sign_dir)/$(app_name); \
echo "Signing app files ... done"; \
fi
tar -czf $(appstore_package_name).tar.gz -C $(appstore_sign_dir) $(app_name)

Loading