-
Notifications
You must be signed in to change notification settings - Fork 10
38 lines (32 loc) · 1.43 KB
/
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
# This is a manually triggered workflow (hence on: workflow_dispatch).
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#manual-events
on: workflow_dispatch
jobs:
publish-go:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Read Tool Versions
id: tool-versions
run: echo "::set-output name=golang::$(sed -nr 's/golang ([0-9]+)/\1/p' .tool-versions)"
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ steps.tool-versions.outputs.golang }}
- name: Generate code for Go users
run: scripts/build-go.sh
# ABLY_COMMON_GO_SSH_KEY is a deploy key, created on the ably-common-go repository.
# see: https://docs.github.com/en/developers/overview/managing-deploy-keys#deploy-keys
# The eval on ssh-agent creates some environment variables.
# Those environment variables exist for the duration of this step only.
- name: Publish
env:
SSH_PRIVATE_KEY: ${{ secrets.ABLY_COMMON_GO_SSH_KEY }}
run: |
echo "$SSH_PRIVATE_KEY" > ssh-private-key.pem
chmod 400 ssh-private-key.pem
eval $(ssh-agent -s)
ssh-add ssh-private-key.pem
git config --global user.name "Ably Common Publish Workflow [bot]"
git config --global user.email "ably-common-publish-workflow[bot]@noreply.ably.com"
scripts/publish-go.sh