adjust makefile and release action

Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
This commit is contained in:
Julien Veyssier 2020-12-28 10:44:45 +01:00
parent 206ee17a24
commit 6a88441cc1
No known key found for this signature in database
GPG key ID: 4141FEE162030638
2 changed files with 20 additions and 8 deletions

View file

@ -19,7 +19,7 @@ jobs:
run: |
git fetch --tags --force
tag=$(git tag -l --points-at HEAD)
vtag=$(echo $tag | grep "v[0-9]\+\.[0-9]\+\.[0-9]\+" || echo "")
vtag=$(echo $tag | grep "^v[0-9]\+\.[0-9]\+\.[0-9]\+" || echo "")
echo "##[set-output name=currenttag;]$vtag"
- name: Build project
@ -33,11 +33,12 @@ jobs:
echo "$APP_KEY" > ~/.nextcloud/certificates/${APP_ID}.key
echo "###### install dependencies"
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update -yqq
sudo apt-get install php7.4-mbstring php7.4-sqlite3 npm make openssl -yqq > /dev/null 2>&1
sudo apt update -y
sudo apt full-upgrade -y
sudo apt install php-mbstring php-sqlite3 npm make openssl -y
echo "###### installing nextcloud"
mkdir ~/html
git clone https://github.com/nextcloud/server.git --recursive --depth 1 -b stable20 ~/html/nextcloud
git clone https://github.com/nextcloud/server.git --recursive --depth 1 -b master ~/html/nextcloud
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"
@ -45,7 +46,7 @@ jobs:
php ~/html/nextcloud/occ maintenance:mode --off
cd ~/html/nextcloud/apps/${APP_ID}
echo "###### npm install"
npm install
npm ci
echo "###### npm run build"
npm run build
echo "###### make appstore"
@ -82,7 +83,7 @@ jobs:
asset_content_type: application/gzip
- name: Publish to appstore
if: ${{ startsWith( steps.tag.outputs.currenttag , 'v' ) }}
if: ${{ startsWith( steps.tag.outputs.currenttag , 'v' ) && !endsWith( steps.tag.outputs.currenttag , 'nightly' ) }}
id: publish
run: |
SIGNATURE=$(cat /tmp/build/sign.txt | tr -d '\n')
@ -91,3 +92,14 @@ jobs:
curl -X POST -H "Authorization: Token $APPSTORE_TOKEN" https://apps.nextcloud.com/api/v1/apps/releases -H "Content-Type: application/json" -d '{"download":"'${DOWNLOAD_URL}'", "signature": "'${SIGNATURE}'"}'
env:
APPSTORE_TOKEN: ${{ secrets.APPSTORE_TOKEN }}
- name: Publish nightly build to appstore
if: ${{ startsWith( steps.tag.outputs.currenttag , 'v' ) && endsWith( steps.tag.outputs.currenttag , 'nightly' ) }}
id: nightly
run: |
SIGNATURE=$(cat /tmp/build/sign.txt | tr -d '\n')
VERSION=${{ steps.build_release.outputs.version }}
DOWNLOAD_URL=https://github.com/${{ github.repository }}/releases/download/v${VERSION}/${APP_ID}-${VERSION}.tar.gz
curl -X POST -H "Authorization: Token $APPSTORE_TOKEN" https://apps.nextcloud.com/api/v1/apps/releases -H "Content-Type: application/json" -d '{"download":"'${DOWNLOAD_URL}'", "signature": "'${SIGNATURE}'", "nightly": true}'
env:
APPSTORE_TOKEN: ${{ secrets.APPSTORE_TOKEN }}

View file

@ -47,12 +47,12 @@ endif
.PHONY: npm
npm:
$(npm) install
$(npm) ci
$(npm) run build
.PHONY: npm-dev
npm-dev:
$(npm) install
$(npm) ci
$(npm) run dev
clean: