Skip to content

Commit

Permalink
feat: test create pr
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoweii committed Jan 8, 2024
1 parent e9d4fcb commit b0c2346
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 40 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/integration_test.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Integration Test

on:
push:
branches: [ "*" ]
pull_request:
branches: [ "*" ]
branches: [ "main" ]
paths:
- 'gradle.properties'

jobs:
build:
Expand All @@ -29,10 +29,10 @@ jobs:
java-version: '8'
distribution: 'corretto'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: build aar
run: ./gradlew assembleRelease
- name: Build SDK release aar file
run: |
chmod +x gradlew
./gradlew assembleRelease
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
Expand All @@ -48,7 +48,7 @@ jobs:
sed -i "s#\"endpoint\": \"your endpoint\"#\"endpoint\": \"${{ env.clickstream_endpoint }}\"#g" app/src/main/res/raw/amplifyconfiguration.json
cat app/src/main/res/raw/amplifyconfiguration.json
./gradlew assembleDebug
- name: Build device farm test file
- name: Build Device Farm test file
run: |
cd integrationtest
pip install virtualenv
Expand Down
58 changes: 26 additions & 32 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
name: Release Next Version
on:
workflow_dispatch:
inputs:
release_tag:
description: 'Release Tag'
required: true
type: string
env:
NEW_VERSION: ${{ github.event.inputs.release_tag }}
push:
branches: [ "*" ]

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:
Expand All @@ -19,28 +17,24 @@ jobs:
ref: main
fetch-depth: 0
token: ${{ secrets.PROJECT_TOKEN }}
- name: Modify for next release
- name: Create new tag
run: |
chmod +x release.sh
./release.sh ${{ env.NEW_VERSION }}
git diff
git config user.name '${{ vars.USER_NAME }}'
git config user.email '${{ vars.USER_EMAIL }}'
git add .
git commit -m 'release: clickstream Android ${{ env.NEW_VERSION }}'
git push
git tag v${{ env.NEW_VERSION }}
git push origin v${{ env.NEW_VERSION }}
- name: Assemble release
run: |
chmod +x gradlew
./gradlew assembleRelease
- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
name: "Clickstream Android ${{ env.NEW_VERSION }}"
files: |
clickstream/build/outputs/aar/clickstream-release.aar
tag_name: "v${{ env.NEW_VERSION }}"
prerelease: true
generate_release_notes: true
version=$(echo "${{ env.COMMIT_MESSAGE }}" | grep -oP 'Android \K\d+\.\d+\.\d+')
echo $version
# git config user.name '${{ vars.USER_NAME }}'
# git config user.email '${{ vars.USER_EMAIL }}'
# git tag v${{ env.NEW_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 ${{ env.NEW_VERSION }}"
# files: |
# clickstream/build/outputs/aar/clickstream-release.aar
# tag_name: "v${{ env.NEW_VERSION }}"
# prerelease: true
# generate_release_notes: true
50 changes: 50 additions & 0 deletions .github/workflows/release_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Create Release PR
on:
workflow_dispatch:
inputs:
release_tag:
description: 'Release Tag'
required: true
type: string
env:
NEW_VERSION: ${{ github.event.inputs.release_tag }}
jobs:
release-pr:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
ref: main
fetch-depth: 0
token: ${{ secrets.PROJECT_TOKEN }}
- name: Modify for next release
run: |
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 }}

0 comments on commit b0c2346

Please sign in to comment.