|
@@ -9,7 +9,6 @@ on:
|
|
|
jobs:
|
|
|
pypi:
|
|
|
runs-on: ubuntu-latest
|
|
|
-
|
|
|
steps:
|
|
|
- uses: actions/checkout@v4
|
|
|
- name: set up Python
|
|
@@ -19,9 +18,8 @@ jobs:
|
|
|
- name: set up Poetry
|
|
|
uses: abatilo/actions-poetry@v3
|
|
|
- name: get version
|
|
|
- id: get_version
|
|
|
- run: echo "VERSION=$(echo ${GITHUB_REF/refs\/tags\//})" >> $GITHUB_ENV
|
|
|
- - name: set version
|
|
|
+ run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
|
|
|
+ - name: Set version
|
|
|
run: poetry version ${{ env.VERSION }}
|
|
|
- name: publish
|
|
|
env:
|
|
@@ -29,7 +27,6 @@ jobs:
|
|
|
run: poetry publish --build
|
|
|
- name: Create GitHub release entry
|
|
|
uses: softprops/action-gh-release@v2
|
|
|
- id: create_release
|
|
|
with:
|
|
|
draft: true
|
|
|
prerelease: false
|
|
@@ -44,7 +41,6 @@ jobs:
|
|
|
docker:
|
|
|
needs: pypi
|
|
|
runs-on: ubuntu-latest
|
|
|
-
|
|
|
steps:
|
|
|
- uses: actions/checkout@v4
|
|
|
- name: Prepare
|
|
@@ -68,13 +64,11 @@ jobs:
|
|
|
fi
|
|
|
|
|
|
# Set output parameters.
|
|
|
- echo ::set-output name=tags::${TAGS}
|
|
|
- echo ::set-output name=docker_image::${DOCKER_IMAGE}
|
|
|
- echo ::set-output name=version::${VERSION}
|
|
|
+ echo "tags=${TAGS}" >> $GITHUB_OUTPUT
|
|
|
+ echo "docker_image=${DOCKER_IMAGE}" >> $GITHUB_OUTPUT
|
|
|
+ echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
|
|
- name: Set up QEMU
|
|
|
- uses: docker/setup-qemu-action@master
|
|
|
- with:
|
|
|
- platforms: all
|
|
|
+ uses: docker/setup-qemu-action@v3
|
|
|
- name: Login to DockerHub
|
|
|
if: github.event_name != 'pull_request'
|
|
|
uses: docker/login-action@v3
|
|
@@ -82,11 +76,15 @@ jobs:
|
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
- name: Set up Docker Buildx
|
|
|
- id: buildx
|
|
|
- uses: docker/setup-buildx-action@master
|
|
|
+ uses: docker/setup-buildx-action@v3
|
|
|
+ - name: Cache Docker layers
|
|
|
+ uses: actions/cache@v3
|
|
|
with:
|
|
|
- install: true
|
|
|
- - name: Build
|
|
|
+ path: /tmp/.buildx-cache
|
|
|
+ key: ${{ runner.os }}-buildx-${{ github.sha }}
|
|
|
+ restore-keys: |
|
|
|
+ ${{ runner.os }}-buildx-
|
|
|
+ - name: Build and push
|
|
|
uses: docker/build-push-action@v6
|
|
|
with:
|
|
|
context: .
|
|
@@ -95,6 +93,15 @@ jobs:
|
|
|
push: true
|
|
|
tags: ${{ steps.prep.outputs.tags }}
|
|
|
build-args: VERSION=${{ steps.prep.outputs.version }}
|
|
|
+ cache-from: type=local,src=/tmp/.buildx-cache
|
|
|
+ cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
|
|
|
+ # Temp fix
|
|
|
+ # https://github.com/docker/build-push-action/issues/252
|
|
|
+ # https://github.com/moby/buildkit/issues/1896
|
|
|
+ - name: Move cache
|
|
|
+ run: |
|
|
|
+ rm -rf /tmp/.buildx-cache
|
|
|
+ mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|
|
|
|
|
|
# Uploading the README.md is not a core feature of docker/build-push-action yet
|
|
|
- name: Update README
|
|
@@ -105,25 +112,20 @@ jobs:
|
|
|
with:
|
|
|
destination_container_repo: zauberzeug/nicegui
|
|
|
provider: dockerhub
|
|
|
- short_description: "Web Based User Interface für Python with Buttons, Dialogs, Markdown, 3D Scences and Plots"
|
|
|
+ short_description: "Web Based User Interface for Python with Buttons, Dialogs, Markdown, 3D Scenes and Plots"
|
|
|
|
|
|
update_metadata:
|
|
|
needs: docker
|
|
|
runs-on: ubuntu-latest
|
|
|
steps:
|
|
|
- - name: Checkout repository
|
|
|
- uses: actions/checkout@v4
|
|
|
+ - uses: actions/checkout@v4
|
|
|
with:
|
|
|
ref: main
|
|
|
-
|
|
|
- - name: Set up Python
|
|
|
- uses: actions/setup-python@v5
|
|
|
+ - uses: actions/setup-python@v5
|
|
|
with:
|
|
|
- python-version: 3.11
|
|
|
-
|
|
|
+ python-version: "3.11"
|
|
|
- name: Update version in pyproject.toml
|
|
|
- run: python .github/workflows/update_pyproject.py $(echo ${GITHUB_REF/refs\/tags\//})
|
|
|
-
|
|
|
+ run: python .github/workflows/update_pyproject.py ${GITHUB_REF#refs/tags/}
|
|
|
- name: Commit and push changes
|
|
|
run: |
|
|
|
git config --global user.name "github-actions[bot]"
|