Skip to content

Commit 37830ba

Browse files
committed
feat: upload dtm core to aws s3
Signed-off-by: Bird <[email protected]>
1 parent 461af71 commit 37830ba

File tree

4 files changed

+39
-24
lines changed

4 files changed

+39
-24
lines changed

.github/workflows/automated-release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
4343
aws-region: ap-southeast-1
4444
- name: upload core
45-
run: bash -e ./hack/release/upload_assets.sh ${{ secrets.GITHUB_TOKEN }} ${{ env.TAG }} ${{ env.GOOS }} ${{ env.GOARCH }}
45+
run: bash -e ./hack/release/upload_dtm_core.sh ${{ secrets.GITHUB_TOKEN }} ${{ env.TAG }} ${{ env.GOOS }} ${{ env.GOARCH }}
4646
- name: upload plugin
4747
run: aws s3 cp ~/.devstream/plugins/ s3://download.devstream.io/${{ env.TAG }}/ --recursive --acl public-read
4848

@@ -77,8 +77,8 @@ jobs:
7777
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
7878
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
7979
aws-region: ap-southeast-1
80-
- name: upload
81-
run: bash -e ./hack/release/upload_assets.sh ${{ secrets.GITHUB_TOKEN }} ${{ env.TAG }} ${{ env.GOOS }} ${{ env.GOARCH }}
82-
- name: upload plugin
80+
- name: upload dtm core to github release and s3
81+
run: bash -e ./hack/release/upload_dtm_core.sh ${{ secrets.GITHUB_TOKEN }} ${{ env.TAG }} ${{ env.GOOS }} ${{ env.GOARCH }}
82+
- name: upload plugins to s3
8383
run: aws s3 cp ~/.devstream/plugins/ s3://download.devstream.io/${{ env.TAG }}/ --recursive --acl public-read
8484

hack/release/auto-release-darwin-arm64.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ plugin_dir=~/.devstream/plugins
3232

3333
GOOS=$(go env GOOS)
3434
GOARCH=$(go env GOARCH)
35+
DTM_CORE_BINARY=dtm-${GOOS}-${GOARCH}
36+
STORAGE_BASE_URL=s3://download.devstream.io
37+
STORAGE_URL_WITH_TAG=${STORAGE_BASE_URL}/${tag}
3538

3639
if [ ! $tag ] || [ ! $user ] || [ ! $repo ] || [ ! $github_token ] || [ ! $plugin_dir ]; then
3740
echo "The following variables cannot be empty!"
@@ -56,11 +59,15 @@ make build -j8
5659
go install github.com/github-release/github-release@latest
5760

5861
# upload dtm
59-
echo 'Uploading 'dtm-${GOOS}-${GOARCH}' ...'
60-
github-release upload --security-token $github_token --user $user --repo $repo --tag $tag --file dtm --name dtm-${GOOS}-${GOARCH}
61-
echo dtm-${GOOS}-${GOARCH}' uploaded.'
62+
echo "Uploading ${DTM_CORE_BINARY} ..."
63+
# upload dtm to github release
64+
github-release upload --security-token $github_token --user $user --repo $repo --tag $tag --file dtm --name ${DTM_CORE_BINARY}
65+
# upload dtm to aws s3
66+
aws s3 cp dtm ${STORAGE_URL_WITH_TAG}/${DTM_CORE_BINARY}
67+
echo "${DTM_CORE_BINARY} uploaded."
6268

6369
# upload plugins and .md5 files
64-
# In order to upload plug-ins to s3, you need to download awscli. After downloading awscli, you need to configure aws credentials.
70+
# In order to upload plug-ins to s3, you need to download aws cli.
71+
# After downloading aws cli, you need to configure aws credentials.
6572
pip3 install awscli
66-
aws s3 cp $plugin_dir s3://download.devstream.io/${tag} --recursive --acl public-read
73+
aws s3 cp $plugin_dir $STORAGE_URL_WITH_TAG --recursive --acl public-read

hack/release/upload_assets.sh

Lines changed: 0 additions & 15 deletions
This file was deleted.

hack/release/upload_dtm_core.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#! /bin/bash -e
2+
3+
github_token=$1
4+
tag=$2
5+
GOOS=$3
6+
GOARCH=$4
7+
8+
DTM_CORE_BINARY=dtm-${GOOS}-${GOARCH}
9+
STORAGE_BASE_URL=s3://download.devstream.io
10+
STORAGE_URL_WITH_TAG=${STORAGE_BASE_URL}/${tag}
11+
12+
user=devstream-io
13+
repo=devstream
14+
plugin_dir=~/.devstream/plugins
15+
16+
# upload dtm core
17+
echo "Uploading ${DTM_CORE_BINARY} ..."
18+
# upload dtm to github release
19+
github-release upload --security-token $github_token --user $user --repo $repo --tag $tag --file dtm --name ${DTM_CORE_BINARY}
20+
# upload dtm to aws s3
21+
aws s3 cp dtm ${STORAGE_URL_WITH_TAG}/${DTM_CORE_BINARY}
22+
echo "${DTM_CORE_BINARY} uploaded."
23+

0 commit comments

Comments
 (0)