-
Notifications
You must be signed in to change notification settings - Fork 48
137 lines (121 loc) · 4.98 KB
/
pre-release.yaml
File metadata and controls
137 lines (121 loc) · 4.98 KB
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
137
#
# Copyright (C) 2021 Wunderman Thompson Technology
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
#
name: pre-release
on:
workflow_dispatch:
inputs:
releaseVersion:
description: Release Version
required: true
jobs:
build:
name: Create Pre-Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Switch to Release Branch
run: |
git checkout -b release/${{ github.event.inputs.releaseVersion }}
- name: Update CHANGELOG.md
run: |
sed -i '/^\*\*List of changes that are finished but not yet released in any final version.\*\*$/a \
\
## Version '"${{ github.event.inputs.releaseVersion }}"'' CHANGELOG.md
- name: Commit changes
run: |
git config --global user.name 'AET Release'
git config --global user.email 'aet-release@users.noreply.github.com'
git commit -am "[AET Release] Update CHANGELOG.md"
git push https://aet-release:${{ secrets.AET_RELEASE_URL_ENCODED_TOKEN }}@github.com/wttech/aet.git
- name: Build Changelog for Github Release
run: |
RELEASE_CHANGELOG=$(sed '/## Version '"${{ github.event.inputs.releaseVersion }}"'/,/## Version/!d;//d' CHANGELOG.md)
echo "Release changelog content: $RELEASE_CHANGELOG" >> /tmp/release_changelog.md
- name: Build project
run: |
./gradlew makeZip -x test -Prelease.forceVersion=${{ github.event.inputs.releaseVersion }}
- name: Create Project Release
run: |
./gradlew release \
-Prelease.forceVersion=${{ github.event.inputs.releaseVersion }} \
-Prelease.customUsername=aet-release \
-Prelease.customPassword=${{ secrets.AET_RELEASE_TOKEN }} \
-Prelease.disableChecks
- name: Create Github Pre-Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
body_path: /tmp/release_changelog.md
tag_name: ${{ github.event.inputs.releaseVersion }}
release_name: ${{ github.event.inputs.releaseVersion }}
prerelease: true
- name: Upload Bundles
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_name: bundles.zip
asset_path: ./zip/build/packages/bundles.zip
asset_content_type: application/zip
- name: Upload Configs
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_name: configs.zip
asset_path: ./zip/build/packages/configs.zip
asset_content_type: application/zip
- name: Upload Features
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_name: features.zip
asset_path: ./zip/build/packages/features.zip
asset_content_type: application/zip
- name: Upload Report
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_name: report.zip
asset_path: ./zip/build/packages/report.zip
asset_content_type: application/zip
- name: Upload Sample Site
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_name: sample-site.zip
asset_path: ./zip/build/packages/sample-site.zip
asset_content_type: application/zip
- name: Create Pull Request
run: |
curl -X POST "https://api.github.com/repos/wttech/aet/pulls?access_token=${{ secrets.RELEASE_PR_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
-d '{"title": "[AET Release] Release ${{ github.event.inputs.releaseVersion }}","head": "release/${{ github.event.inputs.releaseVersion }}","base": "master"}'