From b0f439dd571c7f5599a429f0e8ab3ad777cbb0ef Mon Sep 17 00:00:00 2001 From: Nick Wallace Date: Tue, 6 May 2025 16:47:22 -0500 Subject: [PATCH 1/3] Fixes for snap process --- .../{snap.yaml.disabled => snap.yaml} | 2 +- snap/snapcraft.yaml | 32 ++++++++++++------- 2 files changed, 22 insertions(+), 12 deletions(-) rename .github/workflows/{snap.yaml.disabled => snap.yaml} (97%) diff --git a/.github/workflows/snap.yaml.disabled b/.github/workflows/snap.yaml similarity index 97% rename from .github/workflows/snap.yaml.disabled rename to .github/workflows/snap.yaml index 67084d6e7d..4c99f9426b 100644 --- a/.github/workflows/snap.yaml.disabled +++ b/.github/workflows/snap.yaml @@ -9,7 +9,7 @@ jobs: jobs: name: Job Check runs-on: ubuntu-22.04 - if: "!contains(github.event.head_commit.message, '[skip ci]')" + if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }} steps: - name: Cancel Previous Runs uses: styfle/cancel-workflow-action@0.10.0 diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 6faf23191e..d6ab961b19 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -5,7 +5,7 @@ summary: Request management and media discovery tool for the Plex ecosystem. description: > Overseerr is a free and open source software application for managing requests for your media library. It integrates with your existing services such as Sonarr, Radarr and Plex! -base: core18 +base: core22 confinement: strict architectures: @@ -15,10 +15,9 @@ architectures: parts: overseerr: - plugin: nodejs - nodejs-version: '18.18.2' - nodejs-package-manager: 'yarn' - nodejs-yarn-version: v1.22.19 + plugin: npm + npm-node-version: '18.18.2' + npm-include-node: true build-packages: - git - on arm64: @@ -34,7 +33,7 @@ parts: - python-gi-dev source: . override-pull: | - snapcraftctl pull + craftctl default # Get information to determine snap grade and version git config --global --add safe.directory /data/parts/overseerr/src #setup yarn.rc @@ -61,8 +60,8 @@ parts: \"commit\": \"$COMMIT\"}" echo "{\"commitTag\": \"$COMMIT\"}" > committag.json # Set snap version and grade - snapcraftctl set-version "$SNAP_VERSION" - snapcraftctl set-grade "$GRADE" + craftctl set version="$SNAP_VERSION" + craftctl set grade="$GRADE" build-environment: - PATH: '$SNAPCRAFT_PART_BUILD/node_modules/.bin:$SNAPCRAFT_PART_BUILD/../npm/bin:$PATH' - CYPRESS_INSTALL_BINARY: '0' @@ -70,15 +69,26 @@ parts: set -e # Set COMMIT_TAG before the build begins export COMMIT_TAG=$(cat $SNAPCRAFT_PART_BUILD/commit.txt) + + # Use snapcraftctl build to execute the build step snapcraftctl build + + # Use yarn for building (yarn is already available in /usr/local/bin) yarn build + # Copy files needed for staging cp $SNAPCRAFT_PART_BUILD/committag.json $SNAPCRAFT_PART_INSTALL/ cp -R $SNAPCRAFT_PART_BUILD/.next $SNAPCRAFT_PART_INSTALL/ cp -R $SNAPCRAFT_PART_BUILD/dist $SNAPCRAFT_PART_INSTALL/ cp -R $SNAPCRAFT_PART_BUILD/node_modules $SNAPCRAFT_PART_INSTALL/ + # Remove .github and gitbook as it will fail snap lint - rm -rf $SNAPCRAFT_PART_INSTALL/.github && rm $SNAPCRAFT_PART_INSTALL/.gitbook.yaml + if [ -d "$SNAPCRAFT_PART_INSTALL/.github" ]; then + rm -rf "$SNAPCRAFT_PART_INSTALL/.github" + fi + if [ -f "$SNAPCRAFT_PART_INSTALL/.gitbook.yaml" ]; then + rm "$SNAPCRAFT_PART_INSTALL/.gitbook.yaml" + fi stage-packages: - on armhf: - libatomic1 @@ -87,7 +97,7 @@ parts: apps: daemon: - command: /bin/sh -c "cd $SNAP && node dist/index.js" + command: bin/node dist/index.js daemon: simple restart-condition: on-failure restart-delay: 5s @@ -100,4 +110,4 @@ apps: OVERSEERR_SNAP: 'True' CONFIG_DIRECTORY: $SNAP_USER_COMMON LOG_LEVEL: 'debug' - NODE_ENV: 'production' + NODE_ENV: 'production' \ No newline at end of file From 4dd766d78ee6f31b5db9551c66b551769d33d53a Mon Sep 17 00:00:00 2001 From: Nick Wallace Date: Tue, 6 May 2025 16:47:42 -0500 Subject: [PATCH 2/3] Fixing the snap github workflow --- .github/workflows/snap.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/snap.yaml b/.github/workflows/snap.yaml index 4c99f9426b..54cf076ffa 100644 --- a/.github/workflows/snap.yaml +++ b/.github/workflows/snap.yaml @@ -66,7 +66,7 @@ jobs: discord: name: Send Discord Notification needs: build-snap - if: always() && !contains(github.event.head_commit.message, '[skip ci]') + if: ${{ always() && !contains(github.event.head_commit.message, '[skip ci]') }} runs-on: ubuntu-22.04 steps: - name: Get Build Job Status From 3aff1d2d4aa4e2d6cd1f43857f7c5b57ab4cc650 Mon Sep 17 00:00:00 2001 From: Nick Wallace Date: Tue, 6 May 2025 18:02:52 -0500 Subject: [PATCH 3/3] fix(snap): fixing the snap store package #4095 --- snap/snapcraft.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index d6ab961b19..8845612731 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -69,19 +69,19 @@ parts: set -e # Set COMMIT_TAG before the build begins export COMMIT_TAG=$(cat $SNAPCRAFT_PART_BUILD/commit.txt) - + # Use snapcraftctl build to execute the build step snapcraftctl build - + # Use yarn for building (yarn is already available in /usr/local/bin) yarn build - + # Copy files needed for staging cp $SNAPCRAFT_PART_BUILD/committag.json $SNAPCRAFT_PART_INSTALL/ cp -R $SNAPCRAFT_PART_BUILD/.next $SNAPCRAFT_PART_INSTALL/ cp -R $SNAPCRAFT_PART_BUILD/dist $SNAPCRAFT_PART_INSTALL/ cp -R $SNAPCRAFT_PART_BUILD/node_modules $SNAPCRAFT_PART_INSTALL/ - + # Remove .github and gitbook as it will fail snap lint if [ -d "$SNAPCRAFT_PART_INSTALL/.github" ]; then rm -rf "$SNAPCRAFT_PART_INSTALL/.github" @@ -110,4 +110,4 @@ apps: OVERSEERR_SNAP: 'True' CONFIG_DIRECTORY: $SNAP_USER_COMMON LOG_LEVEL: 'debug' - NODE_ENV: 'production' \ No newline at end of file + NODE_ENV: 'production'