-
Notifications
You must be signed in to change notification settings - Fork 0
executable file
·64 lines (53 loc) · 2.94 KB
/
build-and-upload.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Microweber build & upload
on:
push:
jobs:
microweber-test-before-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/setup-php
with:
php_version: "8.1"
- name: Install Dependencies
run: composer install
- name: Dump autoload dependecies
run: composer dump-autoload
- name: Run PHPUnit
run: php artisan test --debug
microweber-build-and-upload:
runs-on: ubuntu-latest
needs: microweber-test-before-build
steps:
- uses: actions/checkout@v2
- name: Install Dependencies
run: composer install
- name: Dump autoload dependecies
run: composer dump-autoload
- name: Inject slug/short variables
uses: rlespinasse/[email protected]
- name: Zip the files
run: |
rm -rf .git
rm -rf .github
find . \( -name ".git" -o -name ".gitignore" -o -name ".gitmodules" -o -name ".gitattributes" \) -exec rm -rf -- {} +
zip -r microweber-${{ env.GITHUB_REF_SLUG }}.zip `ls -A`
- name: Upload zip
run: |
echo insecure >> ~/.curlrc
curl -T microweber-${{ env.GITHUB_REF_SLUG }}.zip ftp://${{ secrets.FTP_USERNAME }}:${{ secrets.FTP_PASSWORD }}@${{ secrets.FTP_HOST }} --no-epsv
cp microweber-${{ env.GITHUB_REF_SLUG }}.zip microweber.zip
curl -T microweber.zip ftp://${{ secrets.FTP_USERNAME }}:${{ secrets.FTP_PASSWORD }}@${{ secrets.FTP_HOST }}/builds/${{ env.GITHUB_REF_SLUG }}/ --ftp-create-dirs --no-epsv
- name: Upload composer.json
run: |
cp -r composer.json microweber-${{ env.GITHUB_REF_SLUG }}.composer.json
curl -T microweber-${{ env.GITHUB_REF_SLUG }}.composer.json ftp://${{ secrets.FTP_USERNAME }}:${{ secrets.FTP_PASSWORD }}@${{ secrets.FTP_HOST }}
curl -T composer.json ftp://${{ secrets.FTP_USERNAME }}:${{ secrets.FTP_PASSWORD }}@${{ secrets.FTP_HOST }}/builds/${{ env.GITHUB_REF_SLUG }}/ --ftp-create-dirs --no-epsv
curl -T composer.lock ftp://${{ secrets.FTP_USERNAME }}:${{ secrets.FTP_PASSWORD }}@${{ secrets.FTP_HOST }}/builds/${{ env.GITHUB_REF_SLUG }}/ --ftp-create-dirs --no-epsv
- name: Upload version.txt
run: |
cp -r version.txt microweber-${{ env.GITHUB_REF_SLUG }}.version.txt
curl -T microweber-${{ env.GITHUB_REF_SLUG }}.version.txt ftp://${{ secrets.FTP_USERNAME }}:${{ secrets.FTP_PASSWORD }}@${{ secrets.FTP_HOST }} --no-epsv
curl -T version.txt ftp://${{ secrets.FTP_USERNAME }}:${{ secrets.FTP_PASSWORD }}@${{ secrets.FTP_HOST }}/builds/${{ env.GITHUB_REF_SLUG }}/ --ftp-create-dirs --no-epsv
curl -T CHANGELOG.md ftp://${{ secrets.FTP_USERNAME }}:${{ secrets.FTP_PASSWORD }}@${{ secrets.FTP_HOST }}/builds/${{ env.GITHUB_REF_SLUG }}/ --ftp-create-dirs --no-epsv
curl -T README.md ftp://${{ secrets.FTP_USERNAME }}:${{ secrets.FTP_PASSWORD }}@${{ secrets.FTP_HOST }}/builds/${{ env.GITHUB_REF_SLUG }}/ --ftp-create-dirs --no-epsv