Skip to content

Commit

Permalink
Merge pull request #3205 from LibreSign/fix/build-and-publish
Browse files Browse the repository at this point in the history
Fix/build and publish
  • Loading branch information
vitormattos authored Jun 24, 2024
2 parents 9971cf9 + 663e4d4 commit 90e2da7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
21 changes: 14 additions & 7 deletions .github/workflows/appstore-build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
#
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
#
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT

name: Build and publish app release

Expand Down Expand Up @@ -29,7 +32,7 @@ jobs:
echo "APP_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
path: ${{ env.APP_NAME }}

Expand Down Expand Up @@ -60,7 +63,7 @@ jobs:
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
# Skip if no package.json
if: ${{ steps.versions.outputs.npmVersion }}
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'

- name: Get php version
id: php-versions
Expand All @@ -69,7 +72,7 @@ jobs:
filename: ${{ env.APP_NAME }}/appinfo/info.xml

- name: Set up php ${{ steps.php-versions.outputs.php-min }}
uses: shivammathur/setup-php@a4e22b60bbb9c1021113f2860347b0759f66fe5d # v2
uses: shivammathur/setup-php@fc14643b0a99ee9db10a3c025a33d76544fa3761 # v2
with:
php-version: ${{ steps.php-versions.outputs.php-min }}
coverage: none
Expand All @@ -93,10 +96,11 @@ jobs:
if: ${{ steps.versions.outputs.nodeVersion }}
env:
CYPRESS_INSTALL_BINARY: 0
NODE_ENV: production
run: |
cd ${{ env.APP_NAME }}
npm ci
npm run build
npm run build --if-present
- name: Check Krankerl config
id: krankerl
Expand Down Expand Up @@ -126,12 +130,12 @@ jobs:
continue-on-error: true
id: server-checkout
run: |
NCVERSION=${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}
NCVERSION='${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}'
wget --quiet https://download.nextcloud.com/server/releases/latest-$NCVERSION.zip
unzip latest-$NCVERSION.zip
- name: Checkout server master fallback
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
if: ${{ steps.server-checkout.outcome != 'success' }}
with:
submodules: true
Expand All @@ -145,9 +149,12 @@ jobs:
tar -xvf ${{ env.APP_NAME }}.tar.gz
cd ../../../
# Setting up keys
echo "${{ secrets.APP_PRIVATE_KEY }}" > ${{ env.APP_NAME }}.key
echo '${{ secrets.APP_PRIVATE_KEY }}' > ${{ env.APP_NAME }}.key
wget --quiet "https://github.com/nextcloud/app-certificate-requests/raw/master/${{ env.APP_NAME }}/${{ env.APP_NAME }}.crt"
# Signing
php nextcloud/occ libresign:install --all --architecture aarch64
php nextcloud/occ libresign:install --all --architecture x86_64
php nextcloud/occ libresign:developer:sign-setup --privateKey=../${{ env.APP_NAME }}.key --certificate=../${{ env.APP_NAME }}.crt
php nextcloud/occ integrity:sign-app --privateKey=../${{ env.APP_NAME }}.key --certificate=../${{ env.APP_NAME }}.crt --path=../${{ env.APP_NAME }}/build/artifacts/${{ env.APP_NAME }}
# Rebuilding archive
cd ${{ env.APP_NAME }}/build/artifacts
Expand Down
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,12 @@ appstore: clean
mkdir -p $(appstore_sign_dir)/$(app_name)/tests/fixtures
cp tests/fixtures/small_valid.pdf $(appstore_sign_dir)/$(app_name)/tests/fixtures

$(occ) config:app:set libresign certificate_engine --value cfssl
$(occ) libresign:install --all --architecture aarch64
$(occ) libresign:install --all --architecture x86_64
$(occ) libresign:developer:sign-setup --privateKey=$(cert_dir)/$(app_name).key \
--certificate=$(cert_dir)/$(app_name).crt
@if [ ! -f $(cert_dir)/$(app_name).crt ]; 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 \
--certificate=$(cert_dir)/$(app_name).crt \
fi

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

0 comments on commit 90e2da7

Please sign in to comment.