Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update: use a named version folder in NPM tarballs #4094

Merged
merged 9 commits into from
Aug 8, 2017
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/build-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ensureAvailable lintian
ensureAvailable rpmbuild

PACKAGE_TMPDIR=tmp/debian_pkg
VERSION=`dist/bin/yarn --version`
VERSION=`./artifacts/yarn-legacy-* --version`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably revert this back, right?

Copy link
Member Author

@BYK BYK Aug 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we can. I'd leave this one though since this script doesn't rely on dist being there, but the other one does so I'll revert that one before landing.

OUTPUT_DIR=artifacts
TARBALL_NAME=$OUTPUT_DIR/yarn-v$VERSION.tar.gz
DEB_PACKAGE_NAME=yarn_$VERSION'_all.deb'
Expand Down
18 changes: 14 additions & 4 deletions scripts/build-dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ umask 0022 # Ensure permissions are correct (0755 for dirs, 0644 for files)
# Workaround for https://github.com/yarnpkg/yarn/issues/2591
case "$(uname -s)" in
*CYGWIN*|MSYS*|MINGW*)
dist_yarn=dist/bin/yarn.cmd
system_yarn=yarn.cmd
;;
*)
dist_yarn=dist/bin/yarn
system_yarn=yarn
;;
esac
Expand Down Expand Up @@ -49,5 +47,17 @@ cp node_modules/v8-compile-cache/v8-compile-cache.js dist/lib/v8-compile-cache.j
# Verify that it works as expected
[[ "$version" == "$(./dist/bin/yarn --version)" ]] || exit 1;

./scripts/update-dist-manifest.js $(readlink -f dist/package.json) tar
tar -cvzf artifacts/yarn-v$version.tar.gz dist/*
./scripts/update-dist-manifest.js $(node -p -e "require('fs').realpathSync('dist/package.json')") tar

case "$(tar --version)" in
*GNU*)
tar -cvzf artifacts/yarn-v$version.tar.gz --transform="s/^dist/yarn-v$version/" dist/*
;;
bsdtar*)
tar -cvzf artifacts/yarn-v$version.tar.gz -s "/^dist/yarn-v$version/" dist/*
;;
*)
echo "Can't determine tar type (BSD/GNU)!"
exit 1
;;
esac
6 changes: 5 additions & 1 deletion scripts/update-dist-manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@
*/

const fs = require('fs');

const packageManifestFilename = process.argv[2];
const packageManifest = require(packageManifestFilename);

packageManifest.installationMethod = process.argv[3];

if (!packageManifest.installationMethod) {
throw new Error('You need to specify an installation method.');
}

delete packageManifest.dependencies;
delete packageManifest.devDependencies;
delete packageManifest.scripts;
Expand Down
2 changes: 1 addition & 1 deletion scripts/update-npm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

set -ex

version=`./dist/bin/yarn --version`
version=`./artifacts/yarn-legacy-* --version`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This too?

tarball="./artifacts/yarn-v$version.tar.gz"

# Ensure Yarn tarball was built
Expand Down