Skip to content

Commit

Permalink
Updated build workflow and Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
phin05 committed Nov 6, 2023
1 parent 453855b commit ba0129e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
22 changes: 8 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,39 @@
name: Release
run-name: Release ${{ inputs.version || github.ref_name }}
run-name: Release ${{ github.ref_name }}
on:
push:
tags:
- v*
workflow_dispatch:
inputs:
version:
required: true
type: string
description: Version (vX.X.X)
env:
VERSION: ${{ inputs.version || github.ref_name }}
DOCKER_IMAGE_NAME: ghcr.io/${{ github.actor }}/${{ github.event.repository.name }}
jobs:
release-zip:
runs-on: ubuntu-latest
permissions:
contents: write
env:
RELEASE_ZIP_FILENAME: ${{ github.event.repository.name }}-${{ inputs.version || github.ref_name }}.zip
RELEASE_ZIP_FILENAME: ${{ github.event.repository.name }}-${{ github.ref_name }}.zip
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Create release ZIP file
run: |
run: |-
mkdir ${{ github.event.repository.name }}
rm -rf .git .github .gitignore .dockerignore Dockerfile CONTRIBUTING.md pyrightconfig.json
mv * ${{ github.event.repository.name }} || true
zip -r $RELEASE_ZIP_FILENAME ${{ github.event.repository.name }}
- name: Release on GitHub
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
with:
tag_name: ${{ env.VERSION }}
generate_release_notes: true
files: ${{ env.RELEASE_ZIP_FILENAME }}
body: |-
Docker Image: [${{ env.DOCKER_IMAGE_NAME }}](https://${{ env.DOCKER_IMAGE_NAME }})
release-docker:
runs-on: ubuntu-latest
permissions:
packages: write
env:
DOCKER_IMAGE_NAME: ghcr.io/${{ github.actor }}/${{ github.event.repository.name }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -55,7 +49,7 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64,linux/arm/v7
platforms: linux/amd64,linux/arm64,linux/i386,linux/arm
push: true
provenance: false
tags: ${{ env.DOCKER_IMAGE_NAME }}:${{ env.VERSION }},${{ env.DOCKER_IMAGE_NAME }}:latest
tags: ${{ env.DOCKER_IMAGE_NAME }}:${{ github.ref_name }},${{ env.DOCKER_IMAGE_NAME }}:latest
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
FROM python:3.10-alpine
ARG TARGETOS
ARG TARGETARCH
RUN OSARCH="$TARGETOS-$TARGETARCH"; if [[ "$OSARCH" = "linux-386" || "$OSARCH" = "linux-arm" ]]; then apk --no-cache add build-base python3 python3-dev python3-tkinter openssl bash git meson py3-pip sudo freetype-dev fribidi-dev harfbuzz-dev jpeg-dev lcms2-dev libimagequant-dev openjpeg-dev tcl-dev tiff-dev tk-dev zlib-dev; fi
ARG USERNAME=app
ARG USER_UID_GID=10000
RUN addgroup -g $USER_UID_GID $USERNAME && adduser -u $USER_UID_GID -G $USERNAME -D $USERNAME
Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def parsePipPackages(packagesStr: str) -> dict[str, str]:
from core.plex import PlexAlertListener, initiateAuth, getAuthToken
from typing import Optional
from utils.cache import loadCache
from utils.logging import formatter, logger
from utils.logging import logger, formatter
from utils.text import formatSeconds
import logging
import models.config
Expand Down

0 comments on commit ba0129e

Please sign in to comment.