forked from kcl-lang/kcl
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (58 loc) · 1.72 KB
/
release.yaml
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
name: release
on:
push:
branches:
- "main"
tags:
- "v*"
permissions:
contents: write
jobs:
test:
name: Build and release
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
with:
submodules: "true"
# Prerequisite
- name: Install Python3 and LLVM
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y git wget curl make
sudo apt-get install python3 python3-pip -y
sudo apt-get install -y clang-12 lld-12
sudo ln -sf /usr/bin/clang-12 /usr/bin/clang
- name: Install Rust Toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.67
override: true
components: clippy, rustfmt
# KCLVM build
- name: Build KCLVM
run: export PATH=$PATH:$PWD/_build/dist/ubuntu/kclvm/bin && make build
shell: bash
# KCLVM docker image build and upload
- name: Copy Dockerfile to the current work directory
run: cp scripts/docker/kclvm/Dockerfile .
shell: bash
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: kusionstack/kclvm
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}