-
Notifications
You must be signed in to change notification settings - Fork 199
55 lines (48 loc) · 1.82 KB
/
postrelease.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
name: Post Release
on:
pull_request:
branches: [release/*]
types: [closed]
jobs:
PostMerge:
# this job will only run if the PR has been merged
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Setup Node
uses: actions/[email protected]
with:
node-version: '18.x'
- name: Checkout
uses: actions/[email protected]
- name: Extract branch name
id: extract_branch
run: echo "::set-output name=branch::${GITHUB_REF#refs/heads/}"
- name: Extract version
id: extract_version
run: |
version=$(echo ${{ steps.extract_branch.outputs.branch }} | cut --complement -d "/" -f 1)
echo "::set-output name=version::$version"
- name: Extract changelog for version
id: extract_changelog
run: |
changelog=$(node tools/cli/readChangelog.js ${{steps.extract_version.outputs.version}})
changelog="${changelog//'%'/'%25'}"
changelog="${changelog//$'\n'/'%0A'}"
changelog="${changelog//$'\r'/'%0D'}"
echo -e "::set-output name=changelog::$changelog"
- name: Create Github Release
uses: ncipollo/release-action@v1
with:
commit: '${{steps.extract_branch.outputs.branch}}'
tag: 'v${{steps.extract_version.outputs.version}}'
name: 'v${{steps.extract_version.outputs.version}}'
prerelease: false
body: '${{steps.extract_changelog.outputs.changelog}}'
- name: Notify TeamsFx Repo
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.TEAMSFX_REPO_ACCESS_TOKEN }}
repository: OfficeDev/TeamsFx
event-type: teamsjs-released
client-payload: '{"version": "${{ steps.extract_version.outputs.version }}"}'