Skip to content

Commit 55953a7

Browse files
zhu-xiaoweixiaoweii
andauthored
ci: add release new version action (#31)
Co-authored-by: xiaoweii <xiaoweii@amazom.com>
1 parent 4450088 commit 55953a7

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

.github/workflows/release.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Release Next Version
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
release_tag:
6+
description: 'Release Tag'
7+
required: true
8+
type: string
9+
env:
10+
NEW_VERSION: ${{ github.event.inputs.release_tag }}
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
with:
17+
ref: main
18+
fetch-depth: 0
19+
token : ${{ secrets.PROJECT_TOKEN }}
20+
- name: Modify for next release
21+
run: |
22+
chmod +x release.sh
23+
./release.sh ${{ env.NEW_VERSION }}
24+
git diff
25+
git config user.name '${{ vars.USER_NAME }}'
26+
git config user.email '${{ vars.USER_EMAIL }}'
27+
git add .
28+
git commit -m 'release: clickstream Android ${{ env.NEW_VERSION }}'
29+
git push

release.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
version="$1"
4+
packageName="software.aws.solution:clickstream"
5+
regex="[0-9]\+\.[0-9]\+\.[0-9]\+"
6+
7+
sed -i "s/${packageName}:${regex}/${packageName}:${version}/g" README.md
8+
sed -i "s/VERSION_NAME=${regex}/VERSION_NAME=${version}/g" gradle.properties

0 commit comments

Comments
 (0)