From 16a2f4f258f2494863483d368b7a1ea9abfc788b Mon Sep 17 00:00:00 2001 From: Saw-jan Date: Mon, 26 Jan 2026 11:08:35 +0545 Subject: [PATCH] ci: check app release Signed-off-by: Saw-jan --- .github/workflows/check-release.yml | 85 +++++++++++++++++++++++++++++ makefile | 1 + 2 files changed, 86 insertions(+) create mode 100644 .github/workflows/check-release.yml diff --git a/.github/workflows/check-release.yml b/.github/workflows/check-release.yml new file mode 100644 index 000000000..4c2edf0ae --- /dev/null +++ b/.github/workflows/check-release.yml @@ -0,0 +1,85 @@ +# SPDX-FileCopyrightText: 2022-2025 Jankari Tech Pvt. Ltd. +# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors +# SPDX-License-Identifier: AGPL-3.0-or-later +on: + pull_request: + branches: + - release/2.11 + +name: check release + +jobs: + build: + name: Check release in the appstore + # environment: release + env: + APP_ID: integration_openproject + runs-on: ubuntu-latest + steps: + - name: Setup NodeJS + uses: actions/setup-node@v6 + with: + node-version: 20 + + - name: Setup npm + run: npm i -g npm + + - name: Setup PHP + uses: shivammathur/setup-php@a4e22b60bbb9c1021113f2860347b0759f66fe5d + with: + php-version: '8.2' + extensions: mbstring, intl, sqlite3, gd + ini-values: post_max_size=256M, max_execution_time=180 + coverage: xdebug + tools: php-cs-fixer, phpunit + + - name: Checkout code + uses: actions/checkout@v6 + with: + ref: release/2.11 + + - name: Get current tag + id: tag + run: | + echo "currenttag=v2.11.0" >> $GITHUB_OUTPUT + + - name: Build project + if: ${{ startsWith( steps.tag.outputs.currenttag , 'v' ) }} + id: build_release + run: | + echo "app_id=$APP_ID" >> $GITHUB_OUTPUT + echo "###### copy certificate" + mkdir -p ~/.nextcloud/certificates + echo "$APP_CRT" > ~/.nextcloud/certificates/${APP_ID}.crt + echo "$APP_KEY" > ~/.nextcloud/certificates/${APP_ID}.key + echo "###### install dependencies" + export DEBIAN_FRONTEND=noninteractive + sudo apt update -y + sudo apt install make openssl -y + echo "###### installing nextcloud" + mkdir ~/html + git clone https://github.com/nextcloud/server.git --recursive --depth 1 -b stable32 ~/html/nextcloud + 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 "###### build app" + make + echo "###### make appstore" + tag=${{ steps.tag.outputs.currenttag }} + version=${tag/v/} + webserveruser=runner occ_dir=~/html/nextcloud version=$version make appstore + echo "version=$version" >> $GITHUB_OUTPUT + env: + APP_CRT: ${{ secrets.APP_CRT }} + APP_KEY: ${{ secrets.APP_KEY }} + + - name: Publish to appstore + 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}'"}' + env: + APPSTORE_TOKEN: ${{ secrets.APPSTORE_TOKEN }} diff --git a/makefile b/makefile index 747fcf6a8..8a202bb56 100644 --- a/makefile +++ b/makefile @@ -158,6 +158,7 @@ appstore: clean --exclude=tests \ --exclude=ci \ --exclude=vendor/bin \ + --exclude=dev \ $(project_dir) $(sign_dir)/$(app_name) @if [ -f $(cert_dir)/$(app_name).key ]; then \ sudo chown $(webserveruser) $(sign_dir)/$(app_name)/appinfo ;\