-
-
Notifications
You must be signed in to change notification settings - Fork 36
136 lines (121 loc) · 4.05 KB
/
deploy-tag.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
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
136
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow
name: Deploy Tag
on:
release:
types: [published]
env:
ENVIRONMENT_URL: https://wordpress.org/plugins/wp-crontrol
jobs:
wordpress:
name: WordPress.org
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
timeout-minutes: 10
steps:
- uses: octokit/[email protected]
name: Create GitHub deployment
id: deployment
with:
route: POST /repos/:repository/deployments
repository: ${{ github.repository }}
ref: ${{ github.ref }}
required_contexts: "[]"
environment: WordPress.org
description: "Deploy version ${{ github.event.release.tag_name }} to the plugin directory"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: octokit/[email protected]
name: Set GitHub deployment status
with:
route: POST /repos/:repository/deployments/:deployment_id/statuses
repository: ${{ github.repository }}
deployment_id: ${{ fromJson( steps.deployment.outputs.data ).id }}
state: pending
environment_url: ${{ env.ENVIRONMENT_URL }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout repository
uses: actions/checkout@v3
- name: Debugging
run: |
npm --version
- name: Install Dependencies
run: npm install
- name: Populate Changelog
run: |
node .github/workflows/changelog.js readme.md
git config user.name github-actions
git config user.email [email protected]
git add readme.md
git commit -m "Readme"
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: WordPress Plugin Deploy
uses: 10up/[email protected]
env:
SVN_USERNAME: ${{ secrets.WPORG_SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.WPORG_SVN_PASSWORD }}
- name: Deployment Succeeded
if: success()
uses: octokit/[email protected]
with:
route: POST /repos/:repository/deployments/:deployment_id/statuses
repository: ${{ github.repository }}
state: success
deployment_id: ${{ fromJson( steps.deployment.outputs.data ).id }}
environment_url: ${{ env.ENVIRONMENT_URL }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Deployment Failed
if: failure()
uses: octokit/[email protected]
with:
route: POST /repos/:repository/deployments/:deployment_id/statuses
repository: ${{ github.repository }}
state: failure
deployment_id: ${{ fromJson( steps.deployment.outputs.data ).id }}
environment_url: ${{ env.ENVIRONMENT_URL }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
github:
name: GitHub Milestones
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
timeout-minutes: 10
steps:
- name: Get next versions
id: semvers
uses: WyriHaximus/[email protected]
with:
version: ${{ github.event.release.tag_name }}
- name: Create next patch milestone
uses: octokit/[email protected]
with:
route: POST /repos/:repository/milestones
repository: ${{ github.repository }}
title: ${{ steps.semvers.outputs.patch }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true
- name: Create next minor milestone
uses: octokit/[email protected]
with:
route: POST /repos/:repository/milestones
repository: ${{ github.repository }}
title: ${{ steps.semvers.outputs.minor }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true
- name: Create next major milestone
uses: octokit/[email protected]
with:
route: POST /repos/:repository/milestones
repository: ${{ github.repository }}
title: ${{ steps.semvers.outputs.major }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true