-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: 重构 Noneflow #231
feat: 重构 Noneflow #231
Changes from 13 commits
ffc1584
9d51994
a8fd262
ea0854f
8de9239
6132e66
e31d286
4d4ff69
ff6b97c
4afeea7
36caf2e
ac1550a
15e6e53
28f2c3b
7951f9c
36f6c88
bac9e04
41c3d02
2c0befa
0e855e7
f0493e7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Plugin Test Container Builder | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'docker/**' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: Docker | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ['3.9', '3.10', '3.11', '3.12'] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Docker | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to Github Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Generate Tags | ||
uses: docker/metadata-action@v5 | ||
id: metadata | ||
with: | ||
images: ghcr.io/noneflow/nonetest | ||
tags: | | ||
type=semver,pattern={{version}} | ||
type=raw,value=${{ matrix.python-version }}-{{branch}} | ||
|
||
- name: Build and Publish | ||
uses: docker/build-push-action@v5 | ||
with: | ||
file: ./docker/Dockerfile | ||
context: . | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这里把 context 放到 ./docker 就可以了吧,file 参数可以直接删掉。 |
||
push: true | ||
tags: ${{ steps.metadata.outputs.tags }} | ||
labels: ${{ steps.metadata.outputs.labels }} | ||
build-args: PYTHON_VERSION=${{ matrix.python-version }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ jobs: | |
- name: Set up Python | ||
uses: he0119/setup-python@main | ||
with: | ||
python-version: "3.11" | ||
python-version: "3.12" | ||
|
||
- name: Install prerequisites | ||
run: poetry install | ||
|
@@ -32,10 +32,10 @@ jobs: | |
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
docker: | ||
noneflow-docker: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这里的修改没有意义吧 |
||
name: Docker | ||
runs-on: ubuntu-latest | ||
needs: test | ||
# needs: test | ||
if: ${{ github.event_name != 'pull_request' }} | ||
steps: | ||
- name: Checkout | ||
|
@@ -64,6 +64,7 @@ jobs: | |
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
he0119 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
push: true | ||
tags: ${{ steps.metadata.outputs.tags }} | ||
labels: ${{ steps.metadata.outputs.labels }} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,4 +41,4 @@ _✨ NoneBot 工作流管理机器人 ✨_ | |
|
||
## 测试 | ||
|
||
在 [action-test](https://github.com/he0119/action-test) 仓库中测试。 | ||
在 [action-test](https://github.com/BigOrangeQWQ/action-test) 仓库中测试。 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 也许可以建个专门的仓库来测试了。 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,23 @@ | ||||||
ARG PYTHON_VERSION=3.10 | ||||||
|
||||||
FROM python:${PYTHON_VERSION} AS builder | ||||||
|
||||||
RUN apt-get update -y \ | ||||||
&& apt-get install -y curl \ | ||||||
&& rm -rf /var/lib/apt/lists/* | ||||||
|
||||||
RUN curl -sSL https://install.python-poetry.org -o install-poetry.py | ||||||
|
||||||
FROM python:${PYTHON_VERSION}-slim | ||||||
|
||||||
WORKDIR /tmp | ||||||
|
||||||
COPY ./docker/docker_plugin_test.py /tmp/plugin_test.py | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
COPY --from=builder install-poetry.py /tmp/install-poetry.py | ||||||
|
||||||
RUN python install-poetry.py --yes | ||||||
|
||||||
ENV PATH="${PATH}:/root/.local/bin" | ||||||
|
||||||
CMD ["python", "plugin_test.py"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不需要的注释都可以删掉