-
Notifications
You must be signed in to change notification settings - Fork 12
85 lines (73 loc) · 2.82 KB
/
master.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
name: Create Release
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Get Version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}
- name: Get Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
validation_depth: 10
version: ${{ steps.tag_name.outputs.VERSION }}
path: ./CHANGELOG.md
- name: Install Composer Dependencies
run: |
composer install --prefer-dist --no-progress --no-suggest --no-ansi --no-dev --no-interaction --no-plugins --no-progress --no-scripts --optimize-autoloader
- name: Build Plugin Frontend
run: |
cd ./
yarn install
yarn build
- name: Clean Build Files/Folders
run : |
chmod +x ./.deployment/cleanup.sh
sh ./.deployment/cleanup.sh;
- name: Create Sync Zip
run: |
zip -r mesh.zip ./mesh
zip -r mesh-${{ steps.get_version.outputs.VERSION }}.zip ./mesh
- name: Create Release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
${{ steps.changelog_reader.outputs.changes }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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: ./mesh.zip
asset_name: mesh.zip
asset_content_type: application/zip
- name: WordPress Plugin Deploy
uses: 10up/[email protected]
with:
generate-zip: true
env:
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SLUG: mesh
- name: WordPress.org plugin asset/readme update
uses: 10up/action-wordpress-plugin-asset-update@stable
env:
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}