-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (49 loc) · 2.03 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
name: Release
on:
push:
branches: [master]
jobs:
tag:
name: Tag repo
runs-on: ubuntu-latest
steps:
- name: Start Deploy Message
uses: Basis-Theory/github-actions/deploy-slack-action@master
with:
slack-api-token: ${{ secrets.SLACK_DUCKBOT_API_KEY }}
channel: ${{ vars.SLACK_DUCKBOT_RELEASE_CHANNEL_ID }}
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GH_SEMANTIC_RELEASE_PAT }}
- name: Bump version and push tag
id: tag-version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
default_bump: false
tag_prefix: ""
- name: Commit files
if: ${{ steps.tag-version.outputs.release_type != '' }}
run: |
git config --local user.email "[email protected]"
git config --local user.name "github-actions[bot]"
sed -i "s/\(versionName = \)'[^']*'/\1'${{ steps.tag-version.outputs.new_tag }}'/g" lib/build.gradle
sed -i "s/\(basistheory-android:\)[^']*'/\1${{ steps.tag-version.outputs.new_tag }}'/g" README.md
echo "${{ steps.tag-version.outputs.changelog }}" | cat - CHANGELOG.md > temp && mv temp CHANGELOG.md
git add CHANGELOG.md README.md lib/build.gradle
git commit -m "chore(release): updating version and changelog ${{ steps.tag-version.outputs.new_tag }} [skip ci]" || echo "Nothing to update"
- name: Push changes
uses: ad-m/github-push-action@master
if: ${{ steps.tag-version.outputs.release_type != '' }}
with:
github_token: ${{ secrets.GH_SEMANTIC_RELEASE_PAT }}
branch: ${{ github.ref }}
- name: Stop Deploy Message
if: always()
uses: Basis-Theory/github-actions/deploy-slack-action@master
with:
slack-api-token: ${{ secrets.SLACK_DUCKBOT_API_KEY }}
channel: ${{ vars.SLACK_DUCKBOT_RELEASE_CHANNEL_ID }}
status: "done"