-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (54 loc) · 1.76 KB
/
ci.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: ci
on:
push:
release:
types: [published]
jobs:
build_and_release:
name: Build and Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup go-task
uses: arduino/setup-task@v1
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.22.x'
token: ${{ secrets.GITHUB_TOKEN }}
cache-dependency-path: |
datatrails-common-api/go.sum
- name: Setup protobuf
uses: arduino/setup-protoc@v2
with:
version: "24.3"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Generate, Test and Export
run: |
# Note: it is by design that we don't use the builder
task local-all
- name: Show exports
working-directory: exported/
run: find . -type d
- name: Publish release artifacts
if: ${{ github.event_name == 'release' }}
env:
GH_TOKEN: ${{ github.token }}
working-directory: exported
run: |
TAG="$(echo "${GITHUB_REF}" | grep tags | grep -o "[^/]*$" || true)"
# this test will fail if the event type is not 'published'
if [ -z "$TAG" ]; then
echo "::error ::This is not a tagged release"
exit 1
fi
find . -type d
tar -czf proto-include.tar.gz proto-include
gh release upload $TAG proto-include.tar.gz
tar -czf swagger.tar.gz swagger
gh release upload $TAG swagger.tar.gz
tar -czf go-datatrails-common-api-gen.tar.gz go-datatrails-common-api-gen
gh release upload $TAG go-datatrails-common-api-gen.tar.gz