Skip to content

Update Upstream

Update Upstream #17

name: "Update Upstream"
on:
schedule:
- cron: "5 4 * * *"
workflow_dispatch:
jobs:
build:
name: Release
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version-file: go.work
- uses: pnpm/action-setup@v3
with:
package_json_file: buildtools/wasm/package.json
- uses: actions/setup-node@v4
with:
cache: pnpm
cache-dependency-path: buildtools/wasm/pnpm-lock.yaml
- name: Update upstream
run: pnpm up --latest "@connectrpc/*"
working-directory: buildtools/wasm
- run: git diff --exit-code
id: check-diff
continue-on-error: true
# Only update wasm when connect plugin updates, but also update
# bufbuild when doing so.
- name: Update bufbuild
if: steps.check-diff.outcome == 'failure'
run: pnpm up --latest "@bufbuild/*"
working-directory: buildtools/wasm
- run: go run mage updateLibs
if: steps.check-diff.outcome == 'failure'
- name: create PR
if: steps.check-diff.outcome == 'failure'
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git checkout -b update-upstream-${{ github.run_id }}
git add .
git commit -m "Update to latest upstream"
git push -u origin -f update-upstream-${{ github.run_id }}
gh pr create --fill --head update-upstream-${{ github.run_id }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}