Skip to content

Merge pull request #301 from overmindtech/fixifix #686

Merge pull request #301 from overmindtech/fixifix

Merge pull request #301 from overmindtech/fixifix #686

Workflow file for this run

name: Update Libraries
on: push
jobs:
golang:
name: Update Libraries
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Required for `git describe`
- uses: actions/setup-go@v5
with:
go-version: 1.x
check-latest: true
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
cache: npm
- name: Install additional go tooling
run: |
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install connectrpc.com/connect/cmd/protoc-gen-connect-go@latest
- name: Install additional js tooling
run: |
npm ci
- uses: oleksiyrudenko/gha-git-credentials@v2-latest
with:
global: true
name: "Engineering"
actor: "overmindtech"
token: "${{ secrets.SDP_PUSH_TOKEN }}"
- name: Rebuilding generation targets (sdp-go, sdp-js)
run: |
set -x
# remove the symlinks
rm -Rf gen/sdp-go gen/sdp-js
# replace them with full checkouts
git clone https://${GIT_USER}@github.com/overmindtech/sdp-go.git gen/sdp-go.git
git clone https://${GIT_USER}@github.com/overmindtech/sdp-js.git gen/sdp-js.git
# remove previously generated files
rm -Rf gen/sdp-go.git/*.pb.go gen/sdp-go/sdpconnect/*.connect.go
rm -Rf gen/sdp-js.git/src/__generated__/
# generate the code
npx buf generate
SDP_DESCRIBE="$(git describe)"
# add and commit the results
for i in sdp-go sdp-js; do
(
cd gen/$i.git
git pull
cp -av ../$i/* .
git add -A
git commit -m "Updated to SDP ${SDP_DESCRIBE}" || exit 0
# show the results
echo "::group::$i changes"
git show
echo "::endgroup::"
)
done
- name: Push to repos
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') }}
run: |
set -x
for i in sdp-go sdp-js; do
(
cd gen/$i.git
git push
)
done