-
Notifications
You must be signed in to change notification settings - Fork 18
115 lines (109 loc) · 3.59 KB
/
release.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
name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version to release'
required: true
env:
SIGNING_KEY_FILE: /home/runner/secretKey.gpg
jobs:
build_aar:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup Java
uses: ./.github/actions/setup_java
- name: Decode Signing Key
run: ./ci decode_signing_key
env:
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
- name: Assemble
run: ./ci build
env:
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
# Run unit tests after a successful build
unit_test_browser_switch:
name: Unit Test Browser Switch
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup Java
uses: ./.github/actions/setup_java
- name: Run Unit Tests
run: ./ci unit_tests
# Publish after successful build and unit tests
publish_browser_switch:
needs: [ build_aar, unit_test_browser_switch ]
name: Publish To Sonatype
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup Java
uses: ./.github/actions/setup_java
- name: Decode Signing Key
run: ./ci decode_signing_key
env:
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
- name: Update Version
run: ./ci update_version ${{ github.event.inputs.version }}
- name: Publish Browser Switch
run: ./ci publish release
env:
SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
release_finished:
needs: [ publish_browser_switch ]
name: Release Finished
runs-on: ubuntu-latest
steps:
- run: echo "Release finished"
bump_version:
needs: [ release_finished ]
name: Bump Version
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup Java
uses: ./.github/actions/setup_java
- name: Set GitHub User
run: ./ci set_github_user_to_braintreeps
- name: Update Version
run: |
./ci publish_dokka_docs
./ci update_version ${{ github.event.inputs.version }}
./ci commit_and_tag_release ${{ github.event.inputs.version }}
./ci increment_snapshot_version ${{ github.event.inputs.version }}
./ci increment_demo_app_version_code
git commit -am 'Prepare for development'
git push origin main ${{ github.event.inputs.version }}
create_github_release:
needs: [ bump_version ]
name: Create GitHub Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup Java
uses: ./.github/actions/setup_java
- name: Save changelog entries to a file
run: ./ci get_latest_changelog_entries > changelog_entries.md
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.version }}
release_name: ${{ github.event.inputs.version }}
body_path: changelog_entries.md
draft: false
prerelease: false