2020-03-25 14:03:23 +01:00
|
|
|
on:
|
|
|
|
release:
|
|
|
|
types: [released]
|
|
|
|
|
|
|
|
name: Upload Release Asset
|
|
|
|
|
2020-12-19 22:12:39 +01:00
|
|
|
jobs:
|
2020-03-25 14:03:23 +01:00
|
|
|
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
|
|
|
|
|
2020-03-25 14:03:23 +01:00
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v1
|
|
|
|
with:
|
2023-02-16 22:41:07 +01:00
|
|
|
ref: v5-develop
|
2020-03-25 14:03:23 +01:00
|
|
|
|
2020-03-25 22:35:08 +01:00
|
|
|
- name: Copy .env file
|
|
|
|
run: |
|
|
|
|
cp .env.example .env
|
2023-05-01 12:14:15 +02:00
|
|
|
|
2020-03-25 14:03:23 +01:00
|
|
|
- name: Install composer dependencies
|
|
|
|
run: |
|
|
|
|
composer config -g github-oauth.github.com ${{ secrets.GITHUB_TOKEN }}
|
2020-05-14 11:08:49 +02:00
|
|
|
composer install --no-dev
|
2020-03-25 14:03:23 +01:00
|
|
|
|
|
|
|
- name: Prepare Laravel Application
|
|
|
|
run: |
|
|
|
|
cp .env.example .env
|
|
|
|
php artisan key:generate
|
|
|
|
php artisan optimize
|
|
|
|
php artisan storage:link
|
2020-04-02 13:17:56 +02:00
|
|
|
sudo php artisan cache:clear
|
2021-01-19 05:14:45 +01:00
|
|
|
sudo find ./vendor/bin/ -type f -exec chmod +x {} \;
|
2020-04-08 15:31:22 +02:00
|
|
|
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
|
|
|
|
cp -r dist/react/* ../public/react
|
|
|
|
cd ..
|
|
|
|
rm -rf ui
|
2022-05-29 07:04:27 +02:00
|
|
|
php artisan ninja:react
|
2022-05-27 02:11:39 +02:00
|
|
|
|
2020-03-25 14:03:23 +01:00
|
|
|
- name: Prepare JS/CSS assets
|
|
|
|
run: |
|
|
|
|
npm i
|
|
|
|
npm run production
|
2020-04-02 13:17:56 +02:00
|
|
|
|
|
|
|
- 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
|
2020-03-25 14:03:23 +01:00
|
|
|
run: |
|
2023-05-01 15:22:46 +02:00
|
|
|
tar --exclude='.htaccess' -zcvf ./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 }}
|
2023-04-30 13:52:17 +02:00
|
|
|
- name: Upload Artifact
|
|
|
|
uses: actions/upload-artifact@v3
|
2020-03-25 14:03:23 +01:00
|
|
|
with:
|
2023-04-30 13:52:17 +02:00
|
|
|
name: my-artifact
|
2023-05-01 15:11:50 +02:00
|
|
|
path: ./invoiceninja.tar
|