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 :
php-version : 7.4
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 :
2020-10-15 11:45:41 +02:00
ref : v5-stable
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
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 {} \;
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
# - name: Prune Git History
# run: |
# sudo git gc
# sudo git gc --aggressive
# sudo git prune
2020-03-25 14:03:23 +01:00
- name : Build project # This would actually build your project, using zip for an example artifact
run : |
2021-02-25 02:09:22 +01:00
zip -r ./invoiceninja.zip .* -x "../*"
2020-03-25 14:03:23 +01:00
- name : Get tag name
id : get_tag_name
2020-03-25 22:35:08 +01:00
run : echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}-release
2020-03-25 14:03:23 +01:00
- name : Create Release
id : create_release
uses : actions/create-release@v1
env :
2021-06-15 23:31:43 +02:00
GITHUB_TOKEN : ${{ secrets.RELEASE_TOKEN }}
2020-03-25 14:03:23 +01:00
with :
tag_name : ${{ steps.get_tag_name.outputs.VERSION }}
release_name : Release ${{ steps.get_tag_name.outputs.VERSION }}
draft : false
prerelease : false
2021-06-15 23:19:31 +02:00
2020-03-25 14:03:23 +01:00
- name : Upload Release Asset
id : upload-release-asset
uses : actions/upload-release-asset@v1
env :
2021-06-15 23:31:43 +02:00
GITHUB_TOKEN : ${{secrets.RELEASE_TOKEN}}
2020-03-25 14:03:23 +01:00
with :
upload_url : ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path : ./invoiceninja.zip
asset_name : invoiceninja.zip
asset_content_type : application/zip