Skip to content

Create and publish app release #8

Create and publish app release

Create and publish app release #8

name: Create and publish app release
on:
workflow_dispatch:
inputs:
increment:
description: Major/minor/patch?
type: choice
required: true
options:
- major
- minor
- patch
default: patch
env:
PHP_VERSION: 8.1
NC_VERSION: stable27
APP_NAME: money
jobs:
build_and_sign:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.release-it.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: git config
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
extensions: gd, pdo_sqlite
coverage: none
- name: Set up server without SQL
uses: SMillerDev/nextcloud-actions/setup-nextcloud@main
with:
cron: false
version: ${{ env.NC_VERSION }}
- name: Configure server with app
uses: SMillerDev/nextcloud-actions/setup-nextcloud-app@main
with:
app: ${{ env.APP_NAME }}
- run: npm i
working-directory: ../server/apps/${{ env.APP_NAME }}
- run: npx release-it ${{ inputs.increment }}
id: release-it
working-directory: ../server/apps/${{ env.APP_NAME }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
APP_PRIVATE_KEY: ${{ secrets.NC_MONEY_PRIVATE_KEY }}
APP_CERTIFICATE: ${{ secrets.NC_MONEY_CERTIFICATE}}
NC_APP_DIRECTORY: apps
upload_to_store:
runs-on: ubuntu-latest
needs: build_and_sign
steps:
- name: Upload app to Nextcloud appstore
uses: R0Wi/nextcloud-appstore-push-action@a011fe619bcf6e77ddebc96f9908e1af4071b9c1
with:
app_name: ${{ env.APP_NAME }}
appstore_token: ${{ secrets.NC_STORE_API_TOKEN }}
download_url: https://github.com/powerpaul17/nc_money/releases/download/v${{ needs.build_and_sign.outputs.version }}/money.tar.gz
app_private_key: ${{ secrets.NC_MONEY_PRIVATE_KEY }}