Skip to content

Build the App and create release #29

Build the App and create release

Build the App and create release #29

Workflow file for this run

name: Build the App and create realese
on:
release:
type: [published]
workflow_dispatch:
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Setup app env
run: |
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
#echo "APP_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
echo "APP_VERSION=3.0.0" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
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@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
id: versions
# Continue if no package.json
continue-on-error: true
with:
path: ${{ env.APP_NAME }}
fallbackNode: '^20'
fallbackNpm: '^10'
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
# Skip if no package.json
if: ${{ steps.versions.outputs.nodeVersion }}
uses: actions/setup-node@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: Build ${{ env.APP_NAME }}
env:
NODE_ENV: developpement
run: |
cd ${{ env.APP_NAME }}
npm ci
npm run dev
- name: Package ${{ env.APP_NAME }} ${{ env.APP_VERSION }} with makefile
run: |
cd ${{ env.APP_NAME }}
make package
pwd
echo ${{ env.APP_NAME }}
ls -lr build
- name: Attach tarball to github release
uses: svenstaro/upload-release-action@v2
id: attach_to_release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.APP_NAME }}/build/${{ env.APP_NAME }}.tar.gz
asset_name: ${{ env.APP_NAME }}.tar.gz
#tag: ${{ github.ref }}
tag: "V3.0.0"
draft: true
overwrite: true