-
Notifications
You must be signed in to change notification settings - Fork 3
135 lines (113 loc) · 4.21 KB
/
Copy pathrelease.yml
File metadata and controls
135 lines (113 loc) · 4.21 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: Shopware Store Release
on:
push:
tags:
- '*'
env:
PLUGIN_NAME: FinSearch
PLUGIN_MIN_REQUIREMENT: ~6.6.0
SHOPWARE_CLI_ACCOUNT_EMAIL: ${{ secrets.ACCOUNT_USER }}
SHOPWARE_CLI_ACCOUNT_PASSWORD: ${{ secrets.ACCOUNT_PASSWORD }}
SHOPWARE_CLI_COMPANY_ID: 11618
jobs:
validatePlugin:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup PHP with Composer 2
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: mbstring, dom
tools: composer:v2
- name: Install Shopware-CLI
run: |
curl -1sLf "https://dl.cloudsmith.io/public/friendsofshopware/stable/setup.deb.sh" | sudo -E bash
sudo apt install shopware-cli
- name: Validate composer.json
run: composer validate
- name: Remove vendor to ensure clean install
run: rm -rf vendor
- name: Install only production dependencies
run: |
composer install --no-dev --prefer-dist
composer require shopware/core "${{ env.PLUGIN_MIN_REQUIREMENT }}" --no-update
- name: Final cleanup of disallowed files
run: |
rm -rf tests vendor/bin vendor/squizlabs
find . -type f \( \
-name ".phpcs.xml" -o \
-name ".phpunit.xml.dist" -o \
-name ".eslintrc.js" -o \
-name ".editorconfig" -o \
-name ".gitignore" -o \
-name "*.php3" \
\) ! -path "./.gitignore" -delete
- name: Validate plugin files
run: shopware-cli extension validate $(pwd)
- name: Build plugin release zip file
run: shopware-cli extension zip . --disable-git
storeRelease:
if: startsWith(github.ref, 'refs/tags/')
needs: validatePlugin
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup PHP with Composer 2
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: mbstring, dom
tools: composer:v2
- name: Install Shopware-CLI
run: |
curl -1sLf "https://dl.cloudsmith.io/public/friendsofshopware/stable/setup.deb.sh" | sudo -E bash
sudo apt install shopware-cli
- name: Validate composer.json
run: composer validate
- name: Remove vendor to ensure clean install
run: rm -rf vendor
- name: Install only production dependencies
run: |
composer install --no-dev --prefer-dist
composer require shopware/core "${{ env.PLUGIN_MIN_REQUIREMENT }}" --no-update
- name: Final cleanup of disallowed files
run: |
rm -rf tests vendor/bin vendor/squizlabs
find . -type f \( \
-name ".phpcs.xml" -o \
-name ".phpunit.xml.dist" -o \
-name ".eslintrc.js" -o \
-name ".editorconfig" -o \
-name ".gitignore" -o \
-name "*.php3" \
\) ! -path "./.gitignore" -delete
- name: Get version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
- name: Build Plugin Release-Zipfile
run: shopware-cli extension zip . --disable-git
- name: Upload plugin to Shopware Store
run: shopware-cli account producer extension upload $(pwd)/${PLUGIN_NAME}.zip
- name: Create GitHub release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get_version.outputs.VERSION }}
release_name: ${{ steps.get_version.outputs.VERSION }}
body_path: 'docs/release/body.md'
draft: false
prerelease: false
- name: Upload release asset
id: upload_release_asset
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/${{ env.PLUGIN_NAME }}.zip
asset_name: ${{ env.PLUGIN_NAME }}-${{ steps.get_version.outputs.VERSION }}.zip
asset_content_type: application/zip