diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..a55e7a1 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ +<component name="ProjectCodeStyleConfiguration"> + <state> + <option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" /> + </state> +</component> \ No newline at end of file diff --git a/.idea/gitea-deb-builder.iml b/.idea/gitea-deb-builder.iml new file mode 100644 index 0000000..c956989 --- /dev/null +++ b/.idea/gitea-deb-builder.iml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module type="WEB_MODULE" version="4"> + <component name="NewModuleRootManager"> + <content url="file://$MODULE_DIR$" /> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + </component> +</module> \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..48798f7 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ProjectModuleManager"> + <modules> + <module fileurl="file://$PROJECT_DIR$/.idea/gitea-deb-builder.iml" filepath="$PROJECT_DIR$/.idea/gitea-deb-builder.iml" /> + </modules> + </component> +</project> \ No newline at end of file diff --git a/.idea/php.xml b/.idea/php.xml new file mode 100644 index 0000000..f324872 --- /dev/null +++ b/.idea/php.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="MessDetectorOptionsConfiguration"> + <option name="transferred" value="true" /> + </component> + <component name="PHPCSFixerOptionsConfiguration"> + <option name="transferred" value="true" /> + </component> + <component name="PHPCodeSnifferOptionsConfiguration"> + <option name="highlightLevel" value="WARNING" /> + <option name="transferred" value="true" /> + </component> + <component name="PhpStanOptionsConfiguration"> + <option name="transferred" value="true" /> + </component> + <component name="PsalmOptionsConfiguration"> + <option name="transferred" value="true" /> + </component> +</project> \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..8306744 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="VcsDirectoryMappings"> + <mapping directory="" vcs="Git" /> + <mapping directory="$PROJECT_DIR$" vcs="Git" /> + </component> +</project> \ No newline at end of file diff --git a/amd64/DEBIAN/control b/amd64/DEBIAN/control index b291007..a8ad943 100644 --- a/amd64/DEBIAN/control +++ b/amd64/DEBIAN/control @@ -1,5 +1,5 @@ Package: gitea -Version: 1.23.4-1 +Version: 1.23.7 Architecture: amd64 Maintainer: Micha Espey <tracer@24unix.net> Depends: adduser, ca-certificates, git, openssh-server, gpg, jq diff --git a/amd64/opt/gitea/bin/gitea b/amd64/opt/gitea/bin/gitea new file mode 100755 index 0000000..113e837 Binary files /dev/null and b/amd64/opt/gitea/bin/gitea differ diff --git a/arm64/DEBIAN/control b/arm64/DEBIAN/control index 65e7837..4268da7 100644 --- a/arm64/DEBIAN/control +++ b/arm64/DEBIAN/control @@ -1,5 +1,5 @@ Package: gitea -Version: 1.23.4-1 +Version: 1.23.7 Architecture: arm64 Maintainer: Micha Espey <tracer@24unix.net> Depends: adduser, ca-certificates, git, openssh-server, gpg, jq diff --git a/arm64/opt/gitea/bin/gitea b/arm64/opt/gitea/bin/gitea new file mode 100755 index 0000000..2c2a453 Binary files /dev/null and b/arm64/opt/gitea/bin/gitea differ diff --git a/build.sh b/build.sh index e7075a7..1e23705 100755 --- a/build.sh +++ b/build.sh @@ -3,6 +3,13 @@ set -e # Exit on error # Set Variables VERSION=$(curl -s https://dl.gitea.com/gitea/version.json | jq -r '.latest.version') +echo "Current version: ${VERSION}" +# Check if this version is already built +if [[ -f "../gitea-deb/gitea_${VERSION}_amd64.deb" ]] && [[ -f "../gitea-deb/gitea_${VERSION}_arm64.deb" ]]; then + echo "✅ Version ${VERSION} already built and present in release repo. Aborting." + exit 0 +fi + ARCHS=("amd64" "arm64") GITEA_BASE_URL="https://dl.gitea.com/gitea/${VERSION}" FILES=("xz" "xz.asc" "xz.sha256" "xz.sha256.asc") @@ -10,6 +17,10 @@ FILES=("xz" "xz.asc" "xz.sha256" "xz.sha256.asc") # Download Gitea Binaries and Signatures for ARCH in "${ARCHS[@]}"; do echo "Downloading Gitea ${VERSION} for ${ARCH}..." + if [[ ! -d "dist/${ARCH}" ]]; then + echo "Creating directory dist/${ARCH}" + mkdir "dist/${ARCH}" + fi for FILE in "${FILES[@]}"; do FILE_NAME="gitea-${VERSION}-linux-${ARCH}.${FILE}" FILE_URL="${GITEA_BASE_URL}/${FILE_NAME}" @@ -37,8 +48,12 @@ for ARCH in "${ARCHS[@]}"; do (cd "dist/${ARCH}" && sha256sum -c gitea-${VERSION}-linux-${ARCH}.xz.sha256) done -# expand the Gitea binray to the target +# expand the Gitea binary to the target for ARCH in "${ARCHS[@]}"; do + if [[ ! -d "${ARCH}/opt/gitea/bin" ]]; then + echo "Creating directory ${ARCH}/opt/gitea/bin" + mkdir -p "${ARCH}/opt/gitea/bin" + fi xz -dc "dist/${ARCH}/gitea-${VERSION}-linux-${ARCH}.xz" > "${ARCH}/opt/gitea/bin/gitea" || { echo "❌ Extraction failed for ${ARCH}"; exit 1; } # Verify the extracted file isn't empty @@ -52,9 +67,33 @@ done # Build Debian Packages for ARCH in "${ARCHS[@]}"; do echo "Building package for ${ARCH}..." + sed -i "s/^Version: .*/Version: ${VERSION}/" "${ARCH}/DEBIAN/control" dpkg-deb --build "${ARCH}" "gitea_${VERSION}_${ARCH}.deb" done echo "All packages built successfully:" ls -lh gitea_${VERSION}_*.deb +echo "Moving .deb packages to release repo..." +mv gitea_${VERSION}_*.deb ../gitea-deb/ + +cd ../gitea-deb + +echo "Updating APT package index..." +dpkg-scanpackages --multiversion . override > Packages +dpkg-scanpackages --multiversion . override | gzip -9c > Packages.gz + +echo "Generating Release file..." +apt-ftparchive -c=apt-release.conf release . > Release + +git add --all . +if ! git diff --cached --quiet; then + echo "Committing and pushing release..." + git commit -m "Release Gitea ${VERSION}" + git push +else + echo "No changes to commit." +fi + +cd ../gitea-deb-builder +