-
Notifications
You must be signed in to change notification settings - Fork 14
79 lines (66 loc) · 2.36 KB
/
release.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
name: Release
on:
push:
branches:
- main
jobs:
call-workflow-test-plugin:
uses: ./.github/workflows/test-plugin.yml
release:
services:
mariadb:
image: mariadb:10.8.2
ports:
- 3306:3306
env:
MYSQL_ROOT_PASSWORD: root
# Ensure docker waits for mariadb to start
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
name: Release
runs-on: ubuntu-22.04
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Setup Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: 18.x
- name: Install Dependencies
run: npm ci
- name: Create Release Pull Request or Create GitHub Release
id: changesets
uses: changesets/action@v1
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: npm run release
version: npm run version
title: "Release Plugin"
commit: "Release Plugin"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload plugin zip file
if: steps.changesets.outputs.published == 'true'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: "@wpengine/wp-graphql-content-blocks.zip"
asset_name: wp-graphql-content-blocks.zip
tag: ${{ format('v{0}', fromJSON(steps.changesets.outputs.publishedPackages)[0].version) }}
overwrite: true
- name: Setup WordPress to generate static schema
if: steps.changesets.outputs.published == 'true'
uses: ./.github/actions/setup-wordpress
- name: Generate the static schema
if: steps.changesets.outputs.published == 'true'
run: |
cd /tmp/wordpress
# Output: /tmp/schema.graphql
wp graphql generate-static-schema
- name: Upload schema as release artifact
if: steps.changesets.outputs.published == 'true'
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ format('v{0}', fromJSON(steps.changesets.outputs.publishedPackages)[0].version)}}
files: /tmp/schema.graphql
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}