forked from baetyl/baetyl
-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (79 loc) · 3.2 KB
/
image-release.yml
File metadata and controls
81 lines (79 loc) · 3.2 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
name: image-release
on:
push:
tags:
- 'v*'
jobs:
image:
name: docker build baetyl image
runs-on: ubuntu-latest
steps:
- name: Install deps
run: sudo apt update -y && sudo apt install -y qemu qemu-user-static
- name: Install Docker CE for buildx
run: |
sudo apt update
sudo apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt update
sudo apt install docker-ce
docker -v
- name: Checkout code
uses: actions/checkout@v1
- name: docker login
run: |
docker login -u ${{ secrets.DOCKER_REGISTRY_ID }} -p ${{ secrets.DOCKER_REGISTRY_PASS }}
- name: build and publish baetyl image
run: |
make image PLATFORMS=all XFLAGS='--push --cache-to=type=local,dest=/tmp/baetyl' REGISTRY=baetyltech/
package:
name: packages for native mode
runs-on: ubuntu-latest
steps:
- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: 1.13
- name: Checkout code
uses: actions/checkout@v1
- name: package
run: make package PLATFORMS=all
- id: version
run: |
echo ::set-output name=darwin-amd64::$(ls output/darwin/amd64/baetyl | grep zip)
echo ::set-output name=linux-amd64::$(ls output/linux/amd64/baetyl | grep zip)
echo ::set-output name=linux-armv7::$(ls output/linux/arm/v7/baetyl | grep zip)
echo ::set-output name=linux-arm64::$(ls output/linux/arm64/baetyl | grep zip)
- name: Upload darwin-amd64 assets
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.RELEASE_TOKEN }}
file: output/darwin/amd64/baetyl/${{ steps.version.outputs.darwin-amd64 }}
asset_name: ${{ steps.version.outputs.darwin-amd64 }}
tag: ${{ github.ref }}
overwrite: true
- name: Upload linux-amd64 assets
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.RELEASE_TOKEN }}
file: output/linux/amd64/baetyl/${{ steps.version.outputs.linux-amd64 }}
asset_name: ${{ steps.version.outputs.linux-amd64 }}
tag: ${{ github.ref }}
overwrite: true
- name: Upload linux-armv7 assets
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.RELEASE_TOKEN }}
file: output/linux/arm/v7/baetyl/${{ steps.version.outputs.linux-armv7 }}
asset_name: ${{ steps.version.outputs.linux-armv7 }}
tag: ${{ github.ref }}
overwrite: true
- name: Upload linux-arm64 assets
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.RELEASE_TOKEN }}
file: output/linux/arm64/baetyl/${{ steps.version.outputs.linux-arm64 }}
asset_name: ${{ steps.version.outputs.linux-arm64 }}
tag: ${{ github.ref }}
overwrite: true