Skip to content

Commit

Permalink
chores: add release ci
Browse files Browse the repository at this point in the history
Signed-off-by: xiarui.xr <[email protected]>
  • Loading branch information
amyXia1994 committed Dec 11, 2023
1 parent d190cf3 commit 8128967
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Release
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
# push: todo fix
# tags:
# - "v*"
permissions:
contents: write
jobs:
Publish: # Pack and publish image to Docker Hub and Github Release
runs-on: ubuntu-latest
container:
image: smartir/smart-ir-builder:v0.1.0
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Build the Release
run: |
make release
ls ./ # todo remove test
ls ./_build # todo remove test
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/smartir
- name: Build and Push Docker image
uses: docker/build-push-action@v3
with:
context: .
push: true # ${{ github.event_name != 'pull_request' }}
tags: v0.1.0 # ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Upload Artifact to Github Releases
uses: actions/upload-artifact@v3
with:
name: ir-linux-amd64-nightly
path: ir.tgz
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM centos:centos8
COPY _build/sir /sir
COPY ir_example/hello_world.ir /sir/example/hello_world.ir

RUN chmod +x /sir/bin/ir_cli

ENV PATH="/sir/bin:${PATH}"
ENV LANG=en_US.utf8

0 comments on commit 8128967

Please sign in to comment.