-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
xiaoweii
committed
Jan 8, 2024
1 parent
5e8dc2d
commit 9bcfd40
Showing
3 changed files
with
79 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
name: Release Next Version | ||
on: | ||
push: | ||
branches: [ "main" ] | ||
|
||
workflow_dispatch: | ||
inputs: | ||
release_tag: | ||
description: 'Release Tag' | ||
required: true | ||
type: string | ||
env: | ||
NEW_VERSION: ${{ github.event.inputs.release_tag }} | ||
jobs: | ||
release: | ||
if: ${{ startsWith(github.event.head_commit.message, 'release:') }} | ||
release-pr: | ||
runs-on: ubuntu-latest | ||
env: | ||
COMMIT_MESSAGE: ${{ github.event.head_commit.message }} | ||
permissions: | ||
contents: write | ||
steps: | ||
|
@@ -17,26 +19,32 @@ jobs: | |
ref: main | ||
fetch-depth: 0 | ||
token: ${{ secrets.PROJECT_TOKEN }} | ||
- name: Create new tag | ||
run: | | ||
echo "${{ env.COMMIT_MESSAGE }}" | ||
version=$(echo "${{ env.COMMIT_MESSAGE }}" | grep -oP 'Android \K\d+\.\d+\.\d+') | ||
echo "release_version=$version" >> "$GITHUB_ENV" | ||
echo $version | ||
git config user.name '${{ vars.USER_NAME }}' | ||
git config user.email '${{ vars.USER_EMAIL }}' | ||
git tag v$version | ||
git push origin v$version | ||
- name: Assemble release | ||
- name: Modify for next release | ||
run: | | ||
chmod +x gradlew | ||
./gradlew assembleRelease | ||
- name: Create GitHub release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
name: "Clickstream Android $release_version" | ||
files: | | ||
clickstream/build/outputs/aar/clickstream-release.aar | ||
tag_name: "v$release_version" | ||
prerelease: true | ||
generate_release_notes: true | ||
chmod +x release.sh | ||
./release.sh ${{ env.NEW_VERSION }} | ||
git diff | ||
git config user.name "github-actions" | ||
git config user.email "[email protected]" | ||
- name: Create Pull Request | ||
id: create-pr | ||
uses: peter-evans/create-pull-request@v5 | ||
token: ${{ secrets.PROJECT_TOKEN }} | ||
commit-message: 'release: clickstream Android ${{ env.NEW_VERSION }}' | ||
title: 'release: clickstream Android ${{ env.NEW_VERSION }}' | ||
author: github-actions <[email protected]> | ||
committer: github-actions <[email protected]> | ||
signoff: true | ||
body: | | ||
- [x] PR title and description conform to [Pull Request](https://github.com/awslabs/clickstream-android/blob/main/CONTRIBUTING.md#pull-request-guidelines) guidelines. | ||
*Description of changes:* | ||
1. 'release: clickstream Android ${{ env.NEW_VERSION }}' | ||
*Documentation update required?* | ||
- [ ] No | ||
- [x] Yes (Please include a PR link for the documentation update) | ||
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. | ||
labels: release | ||
branch: release_${{ env.NEW_VERSION }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Create Tag And Release | ||
on: | ||
push: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
release: | ||
if: ${{ startsWith(github.event.head_commit.message, 'release:') }} | ||
runs-on: ubuntu-latest | ||
env: | ||
COMMIT_MESSAGE: ${{ github.event.head_commit.message }} | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: main | ||
fetch-depth: 0 | ||
token: ${{ secrets.PROJECT_TOKEN }} | ||
- name: Create new tag | ||
run: | | ||
echo "${{ env.COMMIT_MESSAGE }}" | ||
version=$(echo "${{ env.COMMIT_MESSAGE }}" | grep -oP 'Android \K\d+\.\d+\.\d+') | ||
echo "release_version=$version" >> "$GITHUB_ENV" | ||
echo $version | ||
git config user.name '${{ vars.USER_NAME }}' | ||
git config user.email '${{ vars.USER_EMAIL }}' | ||
git tag v$version | ||
git push origin v$version | ||
- name: Assemble release | ||
run: | | ||
chmod +x gradlew | ||
./gradlew assembleRelease | ||
- name: Create GitHub release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
name: "Clickstream Android $release_version" | ||
files: | | ||
clickstream/build/outputs/aar/clickstream-release.aar | ||
tag_name: "v$release_version" | ||
prerelease: true | ||
generate_release_notes: true |