-
Notifications
You must be signed in to change notification settings - Fork 8
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
Showing
3 changed files
with
100 additions
and
20 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 |
---|---|---|
|
@@ -2,26 +2,60 @@ on: | |
push: | ||
branches: | ||
- 'gen-sdk-updates' | ||
- 'after-release' | ||
|
||
name: Create Changes PR | ||
|
||
# Declare default permissions as read only. | ||
permissions: read-all | ||
|
||
jobs: | ||
create_pr: | ||
name: Create/Update PR | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
# Get GitHub token via the CT SDKs App | ||
- name: Generate GitHub token (via CT SDKs App) | ||
id: generate_github_token | ||
uses: actions/create-github-app-token@v1 | ||
with: | ||
app-id: ${{ secrets.CT_SDKS_APP_ID }} | ||
private-key: ${{ secrets.CT_SDKS_APP_PEM }} | ||
|
||
- name: Get App user | ||
id: get_app_user | ||
env: | ||
GITHUB_TOKEN: ${{ steps.generate_github_token.outputs.token }} | ||
run: | | ||
export GH_APP_USER=`gh api /users/ct-sdks%5Bbot%5D | jq .id` | ||
echo "email=${GH_APP_USER}+ct-sdks[bot]@users.noreply.github.com" >> "$GITHUB_OUTPUT" | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- uses: jenschude/[email protected] | ||
uses: actions/checkout@v4 | ||
with: | ||
token: ${{ steps.generate_github_token.outputs.token }} | ||
|
||
- uses: jenschude/auto-create-pr-action@a5369414c74963e6ec065dab49066d3711b8c1db | ||
if: github.ref_name == "gen-sdk-updates" | ||
with: | ||
request_title: "Update generated SDKs" | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
github_token: ${{ steps.generate_github_token.outputs.token }} | ||
label: automerge | ||
request_body: | | ||
- [ ] Changeset added | ||
### Features | ||
### Fixes | ||
### Breaking changes | ||
- uses: jenschude/auto-create-pr-action@a5369414c74963e6ec065dab49066d3711b8c1db | ||
if: github.ref_name == "after-release" | ||
with: | ||
request_title: "Update changelog" | ||
github_token: ${{ steps.generate_github_token.outputs.token }} | ||
label: automerge | ||
request_body: | | ||
Changelog updates |
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 |
---|---|---|
|
@@ -13,38 +13,80 @@ jobs: | |
if: startsWith( github.ref, 'refs/tags/') | ||
|
||
steps: | ||
# Get GitHub token via the CT SDKs App | ||
- name: Generate GitHub token (via CT SDKs App) | ||
id: generate_github_token | ||
uses: actions/create-github-app-token@v1 | ||
with: | ||
app-id: ${{ secrets.CT_SDKS_APP_ID }} | ||
private-key: ${{ secrets.CT_SDKS_APP_PEM }} | ||
|
||
- name: Get App user | ||
id: get_app_user | ||
env: | ||
GITHUB_TOKEN: ${{ steps.generate_github_token.outputs.token }} | ||
run: | | ||
export GH_APP_USER=`gh api /users/ct-sdks%5Bbot%5D | jq .id` | ||
echo "email=${GH_APP_USER}+ct-sdks[bot]@users.noreply.github.com" >> "$GITHUB_OUTPUT" | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: master | ||
ref: main | ||
token: ${{ steps.generate_github_token.outputs.token }} | ||
|
||
- name: "Switch SDK to after release branch" | ||
run: | | ||
git fetch --depth=1 origin after-release || true | ||
git checkout -B after-release origin/after-release || true | ||
git checkout -B after-release | ||
git log -1 | ||
- name: "remove API reference commit SHA" | ||
run: rm -rf reference.txt | ||
continue-on-error: true | ||
|
||
- uses: stefanzweifel/git-auto-commit-action@v4 | ||
- uses: stefanzweifel/git-auto-commit-action@e8f94e4dd298db5a6a2aa2d42fe0bcef6f2c9660 | ||
with: | ||
commit_message: "TASK: Updating API ref SHA" | ||
commit_user_name: automation-commercetools | ||
commit_user_email: [email protected] | ||
commit_author: Auto Mation <[email protected]> | ||
commit_message: "TASK: Updating version in README" | ||
commit_author: ct-sdks[bot] <${{ steps.get_app_user.outputs.email }}> | ||
commit_user_name: ct-sdks[bot] | ||
commit_user_email: ${{ steps.get_app_user.outputs.email }} | ||
|
||
unittests: | ||
name: Build Docs | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Get GitHub token via the CT SDKs App | ||
- name: Generate GitHub token (via CT SDKs App) | ||
id: generate_github_token | ||
uses: actions/create-github-app-token@v1 | ||
with: | ||
app-id: ${{ secrets.CT_SDKS_APP_ID }} | ||
private-key: ${{ secrets.CT_SDKS_APP_PEM }} | ||
|
||
- name: Get App user | ||
id: get_app_user | ||
env: | ||
GITHUB_TOKEN: ${{ steps.generate_github_token.outputs.token }} | ||
run: | | ||
export GH_APP_USER=`gh api /users/ct-sdks%5Bbot%5D | jq .id` | ||
echo "email=${GH_APP_USER}+ct-sdks[bot]@users.noreply.github.com" >> "$GITHUB_OUTPUT" | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
path: sdk | ||
token: ${{ steps.generate_github_token.outputs.token }} | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
path: doc | ||
ref: gh-pages | ||
token: ${{ steps.generate_github_token.outputs.token }} | ||
|
||
- name: Install Doxygen | ||
run: sudo apt-get install doxygen -y | ||
|
@@ -57,12 +99,12 @@ jobs: | |
env: | ||
PROJECT_NUMBER: ${{ github.ref_name }} | ||
|
||
- run: rsync -r --delete ./sdk/docs ./doc | ||
- run: rsync -r sdk/build/docs/javadoc/ doc/javadoc | ||
|
||
- uses: stefanzweifel/git-auto-commit-action@v4 | ||
- uses: stefanzweifel/git-auto-commit-action@e8f94e4dd298db5a6a2aa2d42fe0bcef6f2c9660 | ||
with: | ||
repository: doc | ||
commit_message: "Update docs" | ||
commit_user_name: automation-commercetools | ||
commit_user_email: [email protected] | ||
commit_author: Auto Mation <[email protected]> | ||
commit_author: ct-sdks[bot] <${{ steps.get_app_user.outputs.email }}> | ||
commit_user_name: ct-sdks[bot] | ||
commit_user_email: ${{ steps.get_app_user.outputs.email }} |
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,4 @@ | ||
version = 1 | ||
|
||
[merge] | ||
show_missing_automerge_label_message = false |