DO NOT MERGE - Version Bump Testing #7
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
name: Update Client SDK Version | |
env: | |
APP_ENV: CI | |
ALCHEMY_PRIVATE_APP_KEY: ${{ secrets.ALCHEMY_PRIVATE_APP_KEY }} | |
ALCHEMY_PUBLIC_APP_KEY: ${{ secrets.ALCHEMY_PUBLIC_APP_KEY }} | |
FEDERATION_POSTGRES_DB_URL: postgresql://commonwealth:edgeware@localhost/common_test | |
on: | |
pull_request: | |
branches: | |
- production | |
jobs: | |
bump_version: | |
name: 'Bump Api Client Version' | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: hicommonwealth/cw_postgres:latest | |
env: | |
POSTGRES_USER: commonwealth | |
POSTGRES_DB: common_test | |
POSTGRES_PASSWORD: edgeware | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
# Maps tcp port 5432 on service container to the host | |
- 5432:5432 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup | |
with: | |
node-version: 20 | |
- name: Bump external API version if necessary | |
run: pnpm -F commonwealth validate-external-api-version | |
- name: Get changed version files | |
id: changed-files-specific | |
uses: tj-actions/changed-files@v35 | |
with: | |
files: | | |
packages/commonwealth/server/external-api-config.json | |
libs/api-client/package.json | |
- name: Format updated files | |
if: steps.changed-files-specific.outputs.any_changed == 'true' | |
run: pnpm dlx prettier --write ./libs/api-client/package.json ./packages/commonwealth/server/external-api-config.json | |
- name: Commit and push updated files | |
if: steps.changed-files-specific.outputs.any_changed == 'true' | |
run: | | |
git config --global user.name "timolegros" | |
git config --global user.email "[email protected]" | |
git add ./libs/api-client/package.json ./packages/commonwealth/server/external-api-config.json | |
git commit -m "chore: update client SDK version" | |
git push origin HEAD | |
# May need to add a `repo` scoped personal access token | |
# if we want to run checks for this new push | |
# https://github.com/peter-evans/create-pull-request/issues/48#issuecomment-536204092 | |
# with: | |
# token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} |