snap: Switch from Embedded Dart Sass to Dart Sass (#11146)

- Continues to get latest version of Dart Sass during each build
- Removes superfluous BUILD_TAGS logic (we only build extended)
This commit is contained in:
Joe Mooring 2023-06-21 15:39:02 -07:00 committed by GitHub
parent b1016d2e26
commit 06d228aad1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -101,13 +101,7 @@ parts:
sed -i '/OsEnv: NewWhitelist/s/)\$/|GIT_EXEC_PATH|LD_LIBRARY_PATH|npm_config_(cache|init_module|userconfig)|pandoc_datadir|PYTHONHOME|RUBYLIB|SNAP&/' config/security/securityConfig.go sed -i '/OsEnv: NewWhitelist/s/)\$/|GIT_EXEC_PATH|LD_LIBRARY_PATH|npm_config_(cache|init_module|userconfig)|pandoc_datadir|PYTHONHOME|RUBYLIB|SNAP&/' config/security/securityConfig.go
git diff config/security/securityConfig.go git diff config/security/securityConfig.go
echo " * SNAPCRAFT_IMAGE_INFO=${SNAPCRAFT_IMAGE_INFO=}"
# Example: SNAPCRAFT_IMAGE_INFO='{"build_url": "https://launchpad.net/~gohugoio/+snap/hugo-extended-dev/+build/344022"}'
export HUGO_BUILD_TAGS=""
if echo $SNAPCRAFT_IMAGE_INFO | grep -q '/+snap/hugo-extended'; then
HUGO_BUILD_TAGS="extended" HUGO_BUILD_TAGS="extended"
fi
echo " * Building hugo (HUGO_BUILD_TAGS=\"$HUGO_BUILD_TAGS\")..." echo " * Building hugo (HUGO_BUILD_TAGS=\"$HUGO_BUILD_TAGS\")..."
go build -v -ldflags "-X github.com/gohugoio/hugo/common/hugo.vendorInfo=snap:$(git describe --tags --always --match 'v[0-9]*' | sed 's/^v//; s/-/+git/; s/-g/./')" -tags "$HUGO_BUILD_TAGS" go build -v -ldflags "-X github.com/gohugoio/hugo/common/hugo.vendorInfo=snap:$(git describe --tags --always --match 'v[0-9]*' | sed 's/^v//; s/-/+git/; s/-g/./')" -tags "$HUGO_BUILD_TAGS"
./hugo version ./hugo version
@ -150,11 +144,11 @@ parts:
*) arch="" ;; *) arch="" ;;
esac esac
if [[ -n $arch ]]; then if [[ -n $arch ]]; then
url=$(curl -s https://api.github.com/repos/sass/dart-sass-embedded/releases/latest | awk -F\" "/browser_download_url.*-linux-${arch}.tar.gz/{print \$(NF-1)}") url=$(curl -s https://api.github.com/repos/sass/dart-sass/releases/latest | awk -F\" "/browser_download_url.*-linux-${arch}.tar.gz/{print \$(NF-1)}")
curl -LO --retry-connrefused --retry 10 "$url" curl -LO --retry-connrefused --retry 10 "${url}"
tar xf sass_embedded-*-linux-$arch.tar.gz tar xf dart-sass-*-linux-${arch}.tar.gz
install -d $SNAPCRAFT_PART_INSTALL/bin install -d $SNAPCRAFT_PART_INSTALL/bin
cp -av sass_embedded/* $SNAPCRAFT_PART_INSTALL/bin/ cp -av dart-sass/* $SNAPCRAFT_PART_INSTALL/bin/
fi fi
node: node: