app_template/.gitea/workflows/app_template.yml

88 lines
3.1 KiB
YAML
Raw Permalink Normal View History

2024-11-10 12:03:55 +00:00
name: app_template
on: [push]
jobs:
xml:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: wget https://raw.githubusercontent.com/nextcloud/appstore/master/nextcloudappstore/api/v1/release/info.xsd
- uses: ChristophWurst/xmllint-action@v1
with:
xml-file: ./appinfo/info.xml
xml-schema-file: ./info.xsd
php:
runs-on: ubuntu-latest
container: nextcloud:30
steps:
- run: apt-get update
- run: apt-get install -y git nodejs
- uses: actions/checkout@v4
- run: curl -sSLo /usr/local/bin/composer https://getcomposer.org/download/latest-stable/composer.phar
- run: chmod +x /usr/local/bin/composer
- run: composer install
- run: composer run lint
- run: composer run cs:check
- run: composer run psalm
nodejs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
2024-11-19 20:04:43 +00:00
- uses: skjnldsv/read-package-engines-version-actions@v3
id: versions
with:
fallbackNode: '^20'
fallbackNpm: '^10'
2024-11-10 12:03:55 +00:00
- uses: actions/setup-node@v4
with:
2024-11-19 20:04:43 +00:00
node-version: ${{ steps.versions.outputs.nodeVersion }}
- run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
2024-11-10 12:03:55 +00:00
- run: npm ci
- run: npm run lint
- run: npm run stylelint
- run: npm run build
release:
if: gitea.ref_type == 'tag'
runs-on: ubuntu-latest
container: nextcloud:30
steps:
- run: apt-get update
- run: apt-get install -y git nodejs
- uses: actions/checkout@v4
- run: curl -sSLo /usr/local/bin/composer https://getcomposer.org/download/latest-stable/composer.phar
- run: chmod +x /usr/local/bin/composer
2024-11-19 20:04:43 +00:00
- uses: skjnldsv/read-package-engines-version-actions@v3
id: versions
with:
fallbackNode: '^20'
fallbackNpm: '^10'
2024-11-10 12:03:55 +00:00
- uses: actions/setup-node@v4
with:
2024-11-19 20:04:43 +00:00
node-version: ${{ steps.versions.outputs.nodeVersion }}
- run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
2024-11-10 12:03:55 +00:00
- run: make dist
- uses: akkuman/gitea-release-action@v1
with:
files: |
build/artifacts/${{ gitea.event.repository.name }}.tar.gz
- uses: FKLC/sign-files-action@v1.0.0
with:
privateKey: ${{ secrets.PRIVATEKEY }}
algorithm: RSA-SHA512
extension: .sig
outputFolder: build/artifacts
files: |
build/artifacts/${{ gitea.event.repository.name }}.tar.gz
- id: sign
run: echo "SIGNATURE=$(cat build/artifacts/${{ gitea.event.repository.name }}.tar.gz.sig | openssl base64 -A)" >> $GITHUB_OUTPUT
- uses: actionsflow/axios@v1
with:
url: https://apps.nextcloud.com/api/v1/apps/releases
method: POST
accept: 200,201
headers: '{ "Authorization": "Token <<<${{ secrets.TOKEN }}>>>" }'
data: '{ "download": "https://git.crystalyx.net/${{ gitea.repository }}/releases/download/<<<${{ gitea.ref_name }}>>>/${{ gitea.event.repository.name }}.tar.gz", "signature": "<<<${{ steps.sign.outputs.SIGNATURE }}>>>" }'