-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (78 loc) · 2.91 KB
/
promote-canary-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: Promote Canary Release
# Update WP repo with the final release version
on:
workflow_dispatch:
jobs:
update-readme-develop:
if: (github.actor == 'ronkelementor' || github.actor == 'KingYes' || github.actor == 'shilo-ey' || github.actor == 'matipojo') && startsWith(github.repository, 'elementor/')
runs-on: ubuntu-20.04
steps:
- name: Checkout develop branch
uses: actions/checkout@v2
with:
token: ${{ secrets.MAINTAIN_TOKEN }}
ref: develop
- name: Install Node.js 16.x
uses: actions/setup-node@v2
with:
node-version: 16.x
- name: Bump version
run: |
PACKAGE_VERSION=$(node -p "require('./package.json').version")
echo "PACKAGE_VERSION=${PACKAGE_VERSION}" >> $GITHUB_ENV
- name: Push new version to develop
env:
PACKAGE_VERSION: ${{ env.PACKAGE_VERSION }}
MAINTAIN_EMAIL: ${{ secrets.MAINTAIN_EMAIL }}
MAINTAIN_USERNAME: ${{ secrets.MAINTAIN_USERNAME }}
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/remove-readme-beta-tag.sh"
bash "${GITHUB_WORKSPACE}/.github/scripts/update-readme-stable-version.sh"
bash "${GITHUB_WORKSPACE}/.github/scripts/commit-push-bump.sh"
promote:
needs: update-readme-develop
runs-on: ubuntu-20.04
steps:
- name: Checkout master branch
uses: actions/checkout@v2
with:
token: ${{ secrets.MAINTAIN_TOKEN }}
ref: master
- name: Install Node.js 16.x
uses: actions/setup-node@v2
with:
node-version: 16.x
- name: Merge develop -> master
uses: devmasx/merge-branch@a1752b9ba42bb417ec19be7dc974e2faf77d3ef2 # v1.3.1
with:
type: now
from_branch: develop
target_branch: master
github_token: ${{ secrets.MAINTAIN_TOKEN }}
- name: Checkout updated master branch
uses: actions/checkout@v2
with:
token: ${{ secrets.MAINTAIN_TOKEN }}
ref: master
- name: Install Dependencies
run: |
PACKAGE_VERSION=$(node -p "require('./package.json').version")
echo "PACKAGE_VERSION=${PACKAGE_VERSION}" >> $GITHUB_ENV
npm install
- name: Build
env:
PACKAGE_VERSION: ${{ env.PACKAGE_VERSION }}
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/build-zip.sh"
- name: Publish to WordPress.org SVN
env:
PLUGIN_VERSION: ${{ env.PACKAGE_VERSION }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/publish-readme-to-wordpress-org.sh"
- name: Upload zip file to GitHub actions artifact
uses: actions/upload-artifact@v2
with:
name: elementor-${{ env.PACKAGE_VERSION }}
path: ${{ github.workspace }}/elementor/**/*