-
Notifications
You must be signed in to change notification settings - Fork 101
85 lines (71 loc) · 2.29 KB
/
changelog-summary-prod.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
name: Changelog Summary - Production
on:
push:
branches:
- production
workflow_dispatch:
permissions:
contents: read
pull-requests: write
jobs:
tag-release:
name: Tag Release
permissions:
contents: write
runs-on: ubuntu-latest
outputs:
id: ${{ steps.id-generator.outputs.id }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@v2.7.0
with:
egress-policy: audit
- name: Check out source code
uses: actions/checkout@v4.2.1
- name: Retrieve tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Get tag name
id: id-generator
run: |
current_date=$(date '+v%Y%m%d.')
minor_version=0
tag=$(git tag -l "${current_date}*" --sort=-version:refname | head -n 1)
if [ -n "${tag}" ]; then
minor_version=$(echo "${tag}" | awk -F. '{print $2+1}')
fi
echo "::set-output name=id::${current_date}${minor_version}"
- name: Tag release
run: git tag ${{ steps.id-generator.outputs.id }}
- name: Push tags
run: git push --tags
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: softprops/action-gh-release@v2.0.8
with:
generate_release_notes: true
tag_name: ${{ steps.id-generator.outputs.id }}
execute:
needs: tag-release
name: Run Summary Generator
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4.2.1
- name: Setup PHP
uses: shivammathur/setup-php@2.30.5
- name: Install
uses: ramsey/composer-install@3.0.0
- name: Execute
env:
CHANGELOG_POST_TOKEN: ${{ secrets.CHANGELOG_BEARER_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
PROJECT_USERNAME: Automattic
PROJECT_REPONAME: vip-go-mu-plugins
BRANCH: ${{ github.ref_name }}
TAG_RELEASE: ${{ needs.tag-release.outputs.id }}
run: |
php ./ci/changelog-summary.php \
--wp-endpoint=https://public-api.wordpress.com/wp/v2/sites/wpvipchangelog.wordpress.com/posts \
--wp-status=draft \
--debug