Skip to content

Commit 7681b1a

Browse files
author
Robin Bryce
committed
ci: developing release job
1 parent e61822f commit 7681b1a

File tree

1 file changed

+30
-34
lines changed

1 file changed

+30
-34
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,15 @@ jobs:
3535
# -I dir compatible location
3636
path: exported/proto-include
3737

38-
# disabled until protos work
39-
#- uses: actions/upload-artifact@v3
40-
# with:
41-
# name: go-datatrails-common-api-swagger
42-
# path: exported/swagger
38+
- uses: actions/upload-artifact@v3
39+
with:
40+
name: go-datatrails-common-api-swagger
41+
path: exported/swagger
4342

44-
#- uses: actions/upload-artifact@v3
45-
# with:
46-
# name: go-datatrails-common-api-gen
47-
# path: exported/datatrails-common-api-gen
43+
- uses: actions/upload-artifact@v3
44+
with:
45+
name: go-datatrails-common-api-gen
46+
path: exported/datatrails-common-api-gen
4847

4948

5049
release:
@@ -57,43 +56,40 @@ jobs:
5756
with:
5857
name: go-datatrails-common-api-proto
5958
path: exported/proto-include
60-
- name: show files
61-
working-directory: exported/proto-include
59+
60+
- uses: actions/download-artifact@v3
61+
with:
62+
name: go-datatrails-common-api-swagger
63+
path: exported/swagger
64+
65+
- uses: actions/download-artifact@v3
66+
with:
67+
name: datatrails-common-api-gen
68+
path: exported/datatrails-common-api-gen
69+
70+
- name: show directories
71+
working-directory: exported/
6272
run: find . -type d
6373
- name: Upload proto files
6474
env:
6575
GH_TOKEN: ${{ github.token }}
6676
working-directory: exported
6777
run: |
6878
TAG="$(echo "${GITHUB_REF}" | grep tags | grep -o "[^/]*$" || true)"
79+
80+
# this test will fail if the event type is not 'published'
6981
if [ -z "$TAG" ]; then
7082
echo "::error ::This is not a tagged release"
7183
exit 1
7284
fi
7385
74-
mv proto-include go-datatrails-common-api-proto
75-
tar -czf go-datatrails-common-api-proto.tar.gz go-datatrails-common-api-proto
76-
86+
mv proto-include go-datatrails-common-api-proto-include
87+
tar -czf go-datatrails-common-api-proto-include.tar.gz go-datatrails-common-api-proto-include
7788
gh release upload $TAG go-datatrails-common-api-proto.tar.gz
7889
79-
# AUTH_HEADER="Authorization: token ${GITHUB_TOKEN}"
80-
# RELEASE_ID=$TAG
81-
82-
# echo "Verifying release"
83-
# HTTP_RESPONSE=$(curl --write-out "HTTPSTATUS:%{http_code}" \
84-
# -sSL \
85-
# -H "${AUTH_HEADER}" \
86-
# "https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/tags/${RELEASE_ID}")
87-
88-
# HTTP_STATUS=$(echo "$HTTP_RESPONSE" | tr -d '\n' | sed -e 's/.*HTTPSTATUS://')
89-
90-
# if [[ "$HTTP_STATUS" -ne 200 ]]; then
91-
# echo "::error ::Release is missing"
92-
# exit 1
93-
# fi
94-
# path=proto-include
95-
96-
# if [[ ! -d $path ]]; then exit 1; fi
90+
mv swagger go-datatrails-common-api-swagger
91+
tar -czf go-datatrails-common-api-swagger.tar.gz go-datatrails-common-api-swagger
92+
gh release upload $TAG go-datatrails-common-api-swagger.tar.gz
9793
98-
# ghr -u "${GITHUB_REPOSITORY%/*}" -r "${GITHUB_REPOSITORY#*/}" "${GITHUB_REF#refs/tags/}" "${path}"
99-
# echo "::debug ::Uploaded $path"
94+
tar -czf go-datatrails-common-api-gen.tar.gz go-datatrails-common-api-gen
95+
gh release upload $TAG go-datatrails-common-api-gen.tar.gz

0 commit comments

Comments
 (0)