Fix #10 - v1.0.6 #24
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow is provided via the organization template repository | |
# | |
# https://github.com/nextcloud/.github | |
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization | |
name: Build and publish app release | |
on: | |
release: | |
types: [published] | |
permissions: | |
contents: write | |
env: | |
APP_NAME: duplicatefinder | |
APP_VERSION: ${{ github.ref_name }} | |
PHP_VERSION: 8.1 | |
jobs: | |
build_and_publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check actor permission | |
uses: skjnldsv/check-actor-permission@e591dbfe838300c007028e1219ca82cc26e8d7c5 # v2.1 | |
with: | |
require: write | |
- name: Checkout | |
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | |
with: | |
path: ${{ env.APP_NAME }} | |
- name: Get appinfo data | |
id: appinfo | |
uses: skjnldsv/xpath-action@7e6a7c379d0e9abc8acaef43df403ab4fc4f770c # master | |
with: | |
filename: ${{ env.APP_NAME }}/appinfo/info.xml | |
expression: "//info//dependencies//nextcloud/@min-version" | |
- name: Read package.json node and npm engines version | |
uses: skjnldsv/read-package-engines-version-actions@0ce2ed60f6df073a62a77c0a4958dd0fc68e32e7 # v2.1 | |
id: versions | |
# Continue if no package.json | |
continue-on-error: true | |
with: | |
path: ${{ env.APP_NAME }} | |
fallbackNode: "^20" | |
fallbackNpm: "^9" | |
- name: Set up node ${{ steps.versions.outputs.nodeVersion }} | |
# Skip if no package.json | |
if: ${{ steps.versions.outputs.nodeVersion }} | |
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3 | |
with: | |
node-version: ${{ steps.versions.outputs.nodeVersion }} | |
- 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 }}" | |
- name: Set up php ${{ env.PHP_VERSION }} | |
uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2 | |
with: | |
php-version: ${{ env.PHP_VERSION }} | |
coverage: none | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build ${{ env.APP_NAME }} | |
# Skip if no package.json | |
if: ${{ steps.versions.outputs.nodeVersion }} | |
run: | | |
cd ${{ env.APP_NAME }} | |
make build | |
- name: Package ${{ env.APP_NAME }} ${{ env.APP_VERSION }} with makefile | |
run: | | |
cd ${{ env.APP_NAME }} | |
make appstore | |
- name: Checkout server ${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }} | |
continue-on-error: true | |
id: server-checkout | |
run: | | |
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: Sign app | |
run: | | |
# Extracting release | |
cd ${{ env.APP_NAME }}/build/artifacts | |
tar -xvf ${{ env.APP_NAME }}.tar.gz | |
cd ../../../ | |
# Setting up keys | |
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 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 | |
tar -zcvf ${{ env.APP_NAME }}.tar.gz ${{ env.APP_NAME }} | |
- name: Attach tarball to github release | |
uses: svenstaro/upload-release-action@2b9d2847a97b04d02ad5c3df2d3a27baa97ce689 # v2 | |
id: attach_to_release | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: ${{ env.APP_NAME }}/build/artifacts/${{ env.APP_NAME }}.tar.gz | |
asset_name: ${{ env.APP_NAME }}-${{ env.APP_VERSION }}.tar.gz | |
tag: ${{ github.ref }} | |
overwrite: true |