-
Notifications
You must be signed in to change notification settings - Fork 17
67 lines (65 loc) · 1.93 KB
/
release.yml
File metadata and controls
67 lines (65 loc) · 1.93 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
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
Artifact: # Pack and publish to Github Artifact
runs-on: ubuntu-latest
container:
image: smartir/smart-ir-builder:main
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Build the Release
working-directory: ir_cli
run: |
rustup default 1.70
source /opt/rh/gcc-toolset-11/enable
make release
ls _build # there should be a ir.tgz file under the ir_cli/_build directory
- name: Upload Artifact to Github Releases
uses: actions/upload-artifact@v3
with:
name: ir-linux-amd64-nightly
path: ir_cli/_build/ir.tgz
Docker: # Download from Github Artifact and build Docker image and push
runs-on: ubuntu-latest
needs: [Artifact]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Download from Artifact
uses: actions/download-artifact@v3
with:
name: ir-linux-amd64-nightly
path: tmp
- name: Check downloaded contents
run: |
mkdir -p _build/sir
tar -xf tmp/ir.tgz -C _build/sir
ls _build/sir
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract Metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: smartir/cli
- name: Build and Push Docker image
uses: docker/build-push-action@v3
with:
context: .
file: ./docker/ir-cli/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}