Skip to content

Commit

Permalink
feat: add release for docker
Browse files Browse the repository at this point in the history
  • Loading branch information
fishros committed Apr 2, 2024
1 parent 0b5c346 commit 23b94c5
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 47 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ jobs:
name: build-artifacts
path: dist

- name: Copy Bin For Docker
run: mkdir dist-for-docker && cp $(ls -1 dist/*) dist-for-docker/fishbot_tool_linux_amd64

- name: Archive build artifacts
uses: actions/upload-artifact@v2
with:
name: build-artifacts-for-docker
path: dist-for-docker


build-windows:
runs-on: windows-latest
steps:
Expand Down Expand Up @@ -87,3 +97,27 @@ jobs:
prerelease: false
files: |
dist/*
release-docker:
runs-on: ubuntu-latest
steps:
- name: Docker login
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Checkout repository
uses: actions/checkout@v2

- name: Download built artifacts
uses: actions/download-artifact@v2
with:
name: build-artifacts-for-docker
path: ./dist-for-docker

- name: Build the Docker image
run: docker build -f Dockerfile -t ${{ secrets.DOCKERHUB_USERNAME }}/fishbot_tool:${{ env.REF_NAME }} .

- name: Docker image push
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/fishbot_tool:${{ env.REF_NAME }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
__pycache__
build/
dist/
*.bin
*.bin
dist-for-docker/
20 changes: 4 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,14 @@
FROM ubuntu:jammy

RUN echo "chooses:\n" > fish_install.yaml \
&& echo "- {choose: 5, desc: '一键安装:ROS(支持ROS和ROS2,树莓派Jetson)'}\n" >> fish_install.yaml \
&& echo "- {choose: 2, desc: 更换源继续安装}\n" >> fish_install.yaml \
&& echo "- {choose: 1, desc: 清理三方源}\n" >> fish_install.yaml \
&& apt update && apt install wget python3 python3-distro python3-yaml -y \
&& wget http://fishros.com/install -O fishros && /bin/bash fishros \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& apt-get clean && apt autoclean \
&& rm -rf fish_install.yaml

# RUN DEBIAN_FRONTEND=noninteractive apt install -y tzdata


RUN apt-get update && apt-get install -y \
wget \
fonts-wqy-zenhei \
libgl1 \
libegl1 \
&& apt-get clean && apt-get autoclean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

COPY "dist/f1.alpha_linux_x64" /fishbot
RUN chmod +x /fishbot
ENTRYPOINT ["/fishbot"]
COPY "dist-for-docker/fishbot_tool_linux_amd64" /fishbot_tool
RUN chmod +x /fishbot_tool
ENTRYPOINT ["/fishbot_tool"]

# docker run -it --rm --privileged -v /dev:/dev -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=unix$DISPLAY fishbot-tool
21 changes: 0 additions & 21 deletions Dockerfile.build

This file was deleted.

8 changes: 0 additions & 8 deletions Dockerfile.build.win

This file was deleted.

2 changes: 1 addition & 1 deletion tool/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ def get_version_data(self):
"""
获取版本数据信息
"""
configs = []
try:
response = requests.get(self.version_info_url)
raw_data = response.text
configs = []
start = raw_data.find("```json")+7
end = raw_data.find('```', start)
while start != -1 and end != -1:
Expand Down

0 comments on commit 23b94c5

Please sign in to comment.