-
Notifications
You must be signed in to change notification settings - Fork 26
68 lines (66 loc) · 1.96 KB
/
release-production-workflow.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
name: Release plugin to production
on:
pull_request:
types:
- closed
branches:
- 'master'
# - 'dev/add-release-workflow'
jobs:
Deploy-To-Production:
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'releases/')
runs-on:
- self-hosted
steps:
- name: Checkout
uses: actions/checkout@v3
- name: PR branch check
uses: mdecoleman/[email protected]
id: vars
with:
repo-token: ${{ secrets.CI_GITHUB_TOKEN }}
- name: Determine release tag and release branch
run: |
TAG=$(echo "${{ steps.vars.outputs.branch }}" | grep -Eo '[0-9]+.[0-9]+.[0-9]+')
echo "PLUGIN_VERSION=$TAG" >> $GITHUB_ENV
echo "RELEASE_BRANCH_NAME=${{ steps.vars.outputs.branch }}" >> $GITHUB_ENV
echo "push new release >> $TAG"
- name: Create release and tag
env:
TAG: ${{env.PLUGIN_VERSION}}
uses: "actions/github-script@v5"
with:
script: |
try {
await github.rest.repos.createRelease({
draft: false,
generate_release_notes: false,
name: process.env.TAG,
owner: context.repo.owner,
prerelease: false,
repo: context.repo.repo,
tag_name: process.env.TAG
});
} catch (error) {
core.setFailed(error.message);
}
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: '11'
- name: Grant execute permission for gradlew
run: |
chmod +x ./gradlew
- name: Publish package
run: |
./gradlew publish
- name: Notify with Slack
uses: slackapi/[email protected]
with:
payload: |
{
"appsflyer_version": "${{env.PLUGIN_VERSION}}",
"environment": "Production"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.CI_SLACK_WEBHOOK_URL }}