1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-11 13:42:49 +01:00
invoiceninja/.github/workflows/release.yml

85 lines
2.6 KiB
YAML
Raw Normal View History

on:
release:
types: [released]
name: Upload Release Asset
2020-12-19 22:12:39 +01:00
jobs:
build:
name: Upload Release Asset
runs-on: ubuntu-latest
steps:
2020-12-19 22:00:02 +01:00
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
2022-07-17 13:20:49 +02:00
php-version: 8.1
2020-12-19 22:00:02 +01:00
extensions: mysql, mysqlnd, sqlite3, bcmath, gd, curl, zip, openssl, mbstring, xml
- name: Checkout code
uses: actions/checkout@v1
with:
2023-09-03 01:14:01 +02:00
ref: v5-develop
2023-09-19 08:46:54 +02:00
- name: Copy .env file
run: |
cp .env.example .env
2023-05-01 12:14:15 +02:00
- name: Install composer dependencies
run: |
composer config -g github-oauth.github.com ${{ secrets.GITHUB_TOKEN }}
composer install --no-dev
- name: Prepare Laravel Application
run: |
cp .env.example .env
2023-08-22 09:06:36 +02:00
php artisan key:generate --force
php artisan optimize
2023-08-22 09:06:36 +02:00
php artisan storage:link --force
sudo php artisan cache:clear
2021-01-19 05:14:45 +01:00
sudo find ./vendor/bin/ -type f -exec chmod +x {} \;
sudo find ./ -type d -exec chmod 755 {} \;
2022-05-27 02:11:39 +02:00
- name: Prepare React FrontEnd
run: |
git clone https://${{secrets.commit_secret}}@github.com/invoiceninja/ui.git
cd ui
git checkout main
npm i
npm run build
2023-09-19 07:58:28 +02:00
2023-09-21 01:23:20 +02:00
mkdir -p ../public/react/${{ github.event.release.tag_name }}/
2023-09-21 00:44:53 +02:00
cp -r dist/react/* ../public/react/${{ github.event.release.tag_name }}/
2023-09-21 05:38:46 +02:00
cp -r dist/react/* ../public/react/
2023-09-19 07:58:28 +02:00
2023-07-06 08:45:16 +02:00
mkdir -p ../public/tinymce_6.4.2/tinymce/js/
2023-07-06 08:05:12 +02:00
cp -r node_modules/tinymce ../public/tinymce_6.4.2/tinymce/js/
2022-05-27 02:11:39 +02:00
cd ..
rm -rf ui
2022-05-29 07:04:27 +02:00
php artisan ninja:react
2022-05-27 02:11:39 +02:00
- name: Prepare JS/CSS assets
run: |
npm i
npm run production
- name: Cleanup Builds
run: |
sudo rm -rf bootstrap/cache/*
2021-01-14 10:31:27 +01:00
sudo rm -rf node_modules
2021-04-20 23:41:50 +02:00
sudo rm -rf .git
2021-10-28 02:21:04 +02:00
sudo rm .env
2021-06-18 15:15:20 +02:00
- name: Build project
run: |
2023-05-02 04:39:16 +02:00
zip -r /home/runner/work/invoiceninja/invoiceninja.zip .* -x "../*"
2023-05-02 15:29:22 +02:00
shopt -s dotglob
2023-05-02 16:00:58 +02:00
tar --exclude='public/storage' --exclude='.htaccess' --exclude='invoiceninja.zip' -zcvf /home/runner/work/invoiceninja/invoiceninja.tar *
2021-06-18 15:01:32 +02:00
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
2021-06-18 15:06:39 +02:00
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
2023-05-02 04:39:16 +02:00
/home/runner/work/invoiceninja/invoiceninja.tar
/home/runner/work/invoiceninja/invoiceninja.zip