Skip to content

Commit ee72fde

Browse files
committed
fix: upload and download ir release pack
Signed-off-by: xiarui.xr <xiarui.xr@antgroup.com>
1 parent 1ebe3ba commit ee72fde

3 files changed

Lines changed: 34 additions & 14 deletions

File tree

.github/workflows/release.yml

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,45 @@ on:
1212
permissions:
1313
contents: write
1414
jobs:
15-
Publish: # Pack and publish image to Docker Hub and Github Release
15+
Artifact: # Pack and publish to Github Artifact
1616
runs-on: ubuntu-latest
1717
container:
18-
image: smartir/smart-ir-builder:v0.1.0
18+
image: smartir/smart-ir-builder:main
1919
steps:
2020
- name: Checkout
2121
uses: actions/checkout@v2
2222
with:
23-
fetch-depth: 0
23+
fetch-depth: 0
2424
- name: Build the Release
2525
working-directory: ir_cli
2626
run: |
27-
rustup default 1.67 # verify problem
27+
rustup default 1.67
2828
make release
29-
ls ./ # todo remove test
30-
ls ./_build # todo remove test
31-
ls ./_build/sir
29+
ls _build # there should be a ir.tgz file under the ir_cli/_build directory
30+
- name: Upload Artifact to Github Releases
31+
uses: actions/upload-artifact@v3
32+
with:
33+
name: ir-linux-amd64-nightly
34+
path: ir_cli/_build/ir.tgz
35+
36+
Docker: # Download from Github Artifact and build Docker image and push
37+
runs-on: ubuntu-latest
38+
needs: [Artifact]
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@v2
42+
with:
43+
fetch-depth: 0
44+
- name: Download from Artifact
45+
uses: actions/download-artifact@v3
46+
with:
47+
name: ir-linux-amd64-nightly
48+
path: tmp
49+
- name: Check downloaded contents
50+
run: |
51+
mkdir -p _build/sir
52+
tar -xf tmp/ir.tgz -C _build/sir
53+
ls _build/sir
3254
- name: Login to Docker Hub
3355
uses: docker/login-action@v2
3456
with:
@@ -44,10 +66,6 @@ jobs:
4466
with:
4567
context: .
4668
push: true # ${{ github.event_name != 'pull_request' }}
47-
tags: v0.1.0 # ${{ steps.meta.outputs.tags }}
69+
tags: smartir/smartir:v0.1.0 # ${{ steps.meta.outputs.tags }}
4870
labels: ${{ steps.meta.outputs.labels }}
49-
- name: Upload Artifact to Github Releases
50-
uses: actions/upload-artifact@v3
51-
with:
52-
name: ir-linux-amd64-nightly
53-
path: ir.tgz
71+

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM centos:centos8
2-
COPY ir_cli/_build/sir /sir
2+
COPY _build/sir /sir
33
COPY ir_example/hello_world.ir /sir/example/hello_world.ir
44

55
RUN chmod +x /sir/bin/ir_cli

docker/ir-cli-builder/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ docker run --platform linux/x86_64 -v ${path-to-Smart-Intermediate-Representatio
1515

1616
# 3. code, build, test in your container:
1717
cd /home/Smart-Intermediate-Representation-project
18+
# set up default rustup version
19+
rustup default 1.67
1820
make install-rustc-wasm
1921
make run-debug
2022
```

0 commit comments

Comments
 (0)