Skip to content

Commit

Permalink
add kodiak config
Browse files Browse the repository at this point in the history
  • Loading branch information
jenschude committed Jan 31, 2024
1 parent ee5cac4 commit d91be46
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 20 deletions.
46 changes: 40 additions & 6 deletions .github/workflows/create-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
70 changes: 56 additions & 14 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
4 changes: 4 additions & 0 deletions .kodiak.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
version = 1

[merge]
show_missing_automerge_label_message = false

0 comments on commit d91be46

Please sign in to comment.