Repository navigation
62 lines (48 loc) · 1.76 KB
/
Copy pathrelease.yml
File metadata and controls
62 lines (48 loc) · 1.76 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
name: Release
on:
release:
types: [published]
permissions:
contents: write
env:
PLUGIN_SLUG: opencode-provider
jobs:
build:
runs-on: ubuntu-latest
name: Build and attach release zip
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Extract version from tag
id: version
run: |
TAG="${{ github.event.release.tag_name }}"
VERSION="${TAG#v}"
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: composer:v2
- name: Install Composer dependencies (no dev)
run: composer install --no-interaction --no-dev --prefer-dist
- name: Copy assets from shared package
run: cp -r vendor/coenjacobs/wordpress-ai-provider/assets assets
- name: Run Mozart to scope dependencies
run: docker run --rm -v "${{ github.workspace }}:/project" coenjacobs/mozart /mozart/bin/mozart compose
- name: Dump Composer autoload
run: composer dump-autoload --no-interaction
- name: Assemble distribution
run: |
mkdir -p "dist/${PLUGIN_SLUG}"
while IFS= read -r entry || [ -n "$entry" ]; do
[ -z "$entry" ] || [ "${entry:0:1}" = "#" ] && continue
cp -r "$entry" "dist/${PLUGIN_SLUG}/"
done < .distinclude
- name: Create zip archive
working-directory: dist
run: zip -r "../${PLUGIN_SLUG}-${{ steps.version.outputs.version }}.zip" "${PLUGIN_SLUG}/"
- name: Upload zip to release
env:
GH_TOKEN: ${{ github.token }}
run: gh release upload "${{ github.event.release.tag_name }}" "${PLUGIN_SLUG}-${{ steps.version.outputs.version }}.zip"