-
Notifications
You must be signed in to change notification settings - Fork 193
87 lines (86 loc) · 3.21 KB
/
automated-release.yml
File metadata and controls
87 lines (86 loc) · 3.21 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: automated release
on:
release:
types: [published]
jobs:
# release for linux
build-and-release-on-linux:
env:
TAG: ${{ github.ref_name }}
USER: devstream-io
REPO: devstream
PLUGINDIR: ~/.devstream/plugins
GOOS: linux
GOARCH: amd64
runs-on: [self-hosted, linux, X64]
steps:
- run: echo "🐧 This job is now running on a ${{ runner.os }}-${{ runner.arch }} server hosted by GitHub!"
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ env.TAG }}
- name: Setup Golang env
uses: actions/setup-go@v3
with:
go-version: 1.18
cache: true
- name: Build
run: make build -j8
- name: Install Github-release
run: go install github.com/github-release/github-release@latest
- name: Install AWS CLI v2
run: |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o /tmp/awscliv2.zip
unzip -q /tmp/awscliv2.zip -d /tmp
rm /tmp/awscliv2.zip
sudo /tmp/aws/install --update
rm -rf /tmp/aws/
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-southeast-1
- name: check md5 & commit
run: git rev-parse HEAD && md5sum dtm*
- name: upload core
run: bash -e ./hack/release/upload_dtm_core.sh ${{ secrets.GITHUB_TOKEN }} ${{ env.TAG }} ${{ env.GOOS }} ${{ env.GOARCH }}
- name: upload plugin
run: aws s3 cp ~/.devstream/plugins/ s3://download.devstream.io/${{ env.TAG }}/ --recursive --acl public-read
# release for darwin-amd64
build-and-release-on-darwin-amd64:
env:
TAG: ${{ github.ref_name }}
USER: devstream-io
REPO: devstream
PLUGINDIR: ~/.devstream/plugins
GOOS: darwin
GOARCH: amd64
runs-on: macos-latest
steps:
- run: echo "🐧 This job is now running on a ${{ runner.os }}-${{ runner.arch }} server hosted by GitHub!"
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ env.TAG }}
- name: Setup Golang env
uses: actions/setup-go@v3
with:
go-version: 1.18
cache: true
- name: Build
run: make build -j8
- name: Install Github-release
run: go install github.com/github-release/github-release@latest
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-southeast-1
- name: update dtm version on s3
run: ./hack/release/update_dtm_version_on_s3.sh ${{ env.TAG }}
- name: upload dtm core to github release and s3
run: bash -e ./hack/release/upload_dtm_core.sh ${{ secrets.GITHUB_TOKEN }} ${{ env.TAG }} ${{ env.GOOS }} ${{ env.GOARCH }}
- name: upload plugins to s3
run: aws s3 cp ~/.devstream/plugins/ s3://download.devstream.io/${{ env.TAG }}/ --recursive --acl public-read