-
Notifications
You must be signed in to change notification settings - Fork 2
48 lines (47 loc) · 1.62 KB
/
build-and-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
---
name: Build and Publish
on:
push:
branches:
- master
workflow_dispatch:
jobs:
build-and-publish:
name: Build and publish
runs-on: ubuntu-latest
# here we reuse an image that is maintained for the CS3APIs bindings, which contains the necessary tools (buf)
# see https://github.com/cs3org/cs3apis-build/blob/master/Dockerfile
container: cs3org/cs3apis-build:master
steps:
- name: Checkout
uses: actions/checkout@v4
- name: setup-ssh
env:
SSH_KEY: ${{ secrets.ssh_key }}
run: |
mkdir /root/.ssh
python3 -c "import os; file = open('/root/.ssh/id_rsa', 'w'); file.write(os.environ['SSH_KEY']); file.close()"
chmod 400 /root/.ssh/id_rsa
touch /root/.ssh/known_hosts
chmod 400 /root/.ssh/known_hosts
ssh-keyscan -H github.com > /etc/ssh/ssh_known_hosts 2> /dev/null
- name: build-and-push
run: |
buf generate
sed -i 's/go_eosgrpc/go-eosgrpc/' build/*.go
cd ..
git clone git+ssh://[email protected]/cern-eos/go-eosgrpc
cd go-eosgrpc
git config user.email "[email protected]"
git config user.name "cernbox-bot"
cp ../grpc-proto/build/*.go .
git add .
git commit -m 'Synced to https://github.com/cern-eos/grpc-proto/tree/${{ github.sha }}'
git push origin main
- name: setup-buf
uses: bufbuild/buf-setup-action@v1
- name: push-buf
uses: bufbuild/buf-push-action@v1
with:
buf_token: ${{ secrets.BUF_TOKEN }}
draft: ${{ github.ref_name != 'master'}}