Skip to content

refactor: use separate cache key in release, run standalone after caching #5859

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

Merged
merged 29 commits into from
Dec 12, 2022
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
a958055
refactor: remove keytar dep in cross-compile
jsjoeio Dec 8, 2022
fb827b6
refactor: try other keytar package
jsjoeio Dec 8, 2022
4e97fb9
refactor: remove keytar step in cross-compile
jsjoeio Dec 8, 2022
679bdf2
fix: manually remove keytar
jsjoeio Dec 8, 2022
9b37897
try this first
jsjoeio Dec 8, 2022
5c566b0
I think this is it
jsjoeio Dec 8, 2022
d3e45dd
Revert "I think this is it"
jsjoeio Dec 8, 2022
a2ff453
okay this is it
jsjoeio Dec 8, 2022
e4388cc
fixup
jsjoeio Dec 8, 2022
4a922ae
try legacy peer
jsjoeio Dec 8, 2022
cfa03cb
remove keytar before standalone
jsjoeio Dec 8, 2022
d25d4fe
wrong path
jsjoeio Dec 8, 2022
73225bb
maybe
jsjoeio Dec 8, 2022
aedd3ef
revert: change *npm* back to npm*
jsjoeio Dec 8, 2022
00ad39e
revert: don't uninstall keytar
jsjoeio Dec 8, 2022
8fcb733
fix: use npm run standalone-release
jsjoeio Dec 8, 2022
7c10b83
fixup formatting
jsjoeio Dec 8, 2022
9fec203
Revert "refactor: remove yarn.lock steps (#5850)"
jsjoeio Dec 8, 2022
893d071
fixup: remove the --exclude
jsjoeio Dec 8, 2022
8469acb
refactor: remove yarn.lock check
jsjoeio Dec 8, 2022
44339d5
try ddd in postinstall
jsjoeio Dec 9, 2022
0455b1f
refactor: cache before release:standalone
jsjoeio Dec 9, 2022
808b582
refactor: add os to cache key in release
jsjoeio Dec 9, 2022
9cfdfbe
Merge branch 'main' into jsjoeio/fix-cross-compile
jsjoeio Dec 12, 2022
59044bd
Merge branch 'jsjoeio/fix-cross-compile' into jsjoeio/wip-fix
jsjoeio Dec 12, 2022
cfdaa7f
chore: formatting
jsjoeio Dec 12, 2022
4c77d31
Update ci/build/npm-postinstall.sh
jsjoeio Dec 12, 2022
f15775d
Merge branch 'main' into jsjoeio/wip-fix
jsjoeio Dec 12, 2022
0da120f
fixup: formatting
jsjoeio Dec 12, 2022
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
29 changes: 14 additions & 15 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,19 @@ jobs:
- name: Decompress npm package
run: tar -xzf package.tar.gz

# NOTE: && here is deliberate - GitHub puts each line in its own `.sh`
# file when running inside a docker container.
- name: Build standalone release
run: source scl_source enable devtoolset-9 && yarn release:standalone

- name: Fetch dependencies from cache
id: cache-node-modules
uses: actions/cache@v3
with:
path: "**/node_modules"
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
key: yarn-build-linux-amd64-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
yarn-build-
yarn-build-linux-amd64-

# NOTE: && here is deliberate - GitHub puts each line in its own `.sh`
# file when running inside a docker container.
- name: Build standalone release
run: source scl_source enable devtoolset-9 && npm run release:standalone

- name: Install test dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -172,9 +172,6 @@ jobs:
env:
PACKAGE: ${{ format('g++-{0}', matrix.prefix) }}

- name: Install keytar dependencies
run: sudo apt install -y libsecret-1-dev

- name: Download npm package
uses: actions/download-artifact@v3
with:
Expand All @@ -183,6 +180,8 @@ jobs:
- name: Decompress npm package
run: tar -xzf package.tar.gz

# NOTE@jsjoeio - npm fails here
# so use yarn
- name: Build standalone release
run: yarn release:standalone

Expand Down Expand Up @@ -238,17 +237,17 @@ jobs:
- name: Decompress npm package
run: tar -xzf package.tar.gz

- name: Build standalone release
run: yarn release:standalone

- name: Fetch dependencies from cache
id: cache-node-modules
uses: actions/cache@v3
with:
path: "**/node_modules"
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
key: yarn-build-macos-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
yarn-build-
yarn-build-macos-

- name: Build standalone release
run: npm run release:standalone

- name: Install test dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
Expand Down
3 changes: 3 additions & 0 deletions ci/build/build-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ bundle_code_server() {
}
EOF
) > "$RELEASE_PATH/package.json"
rsync yarn.lock "$RELEASE_PATH"
mv npm-shrinkwrap.json "$RELEASE_PATH"

rsync ci/build/npm-postinstall.sh "$RELEASE_PATH/postinstall.sh"
Expand Down Expand Up @@ -96,10 +97,12 @@ bundle_vscode() {
"$VSCODE_SRC_PATH/remote/package.json" \
"$VSCODE_SRC_PATH/package.json" > "$VSCODE_OUT_PATH/package.json"

rsync "$VSCODE_SRC_PATH/remote/yarn.lock" "$VSCODE_OUT_PATH/yarn.lock"
mv "$VSCODE_SRC_PATH/remote/npm-shrinkwrap.json" "$VSCODE_OUT_PATH/npm-shrinkwrap.json"

# Include global extension dependencies as well.
rsync "$VSCODE_SRC_PATH/extensions/package.json" "$VSCODE_OUT_PATH/extensions/package.json"
rsync "$VSCODE_SRC_PATH/extensions/yarn.lock" "$VSCODE_OUT_PATH/extensions/yarn.lock"
mv "$VSCODE_SRC_PATH/extensions/npm-shrinkwrap.json" "$VSCODE_OUT_PATH/extensions/npm-shrinkwrap.json"
rsync "$VSCODE_SRC_PATH/extensions/postinstall.mjs" "$VSCODE_OUT_PATH/extensions/postinstall.mjs"
}
Expand Down
22 changes: 6 additions & 16 deletions ci/build/npm-postinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,24 +128,14 @@ install_with_yarn_or_npm() {
# NOTE@edvincent: We want to keep using the package manager that the end-user was using to install the package.
# This also ensures that when *we* run `yarn` in the development process, the yarn.lock file is used.
case "${npm_config_user_agent-}" in
*npm*)
if [ -f "yarn.lock" ]; then
echo "yarn.lock file present, running in development mode. use yarn to install code-server!"
exit 1
else
# HACK: NPM's use of semver doesn't like resolving some peerDependencies that vscode (upstream) brings in the form of pre-releases.
# The legacy behavior doesn't complain about pre-releases being used, falling back to that for now.
# See https://github.com//pull/5071
npm install --unsafe-perm --legacy-peer-deps --omit=dev
fi
npm*)
# HACK: NPM's use of semver doesn't like resolving some peerDependencies that vscode (upstream) brings in the form of pre-releases.
# The legacy behavior doesn't complain about pre-releases being used, falling back to that for now.
# See https://github.com//pull/5071
npm install --unsafe-perm --legacy-peer-deps --omit=dev -ddd
Copy link
Member

Choose a reason for hiding this comment

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

What is this -ddd option?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Silly logging! https://docs.npmjs.com/cli/v8/using-npm/logging#aliases

I may want to remove it though 🤔

;;
yarn*)
if [ -f "yarn.lock" ]; then
yarn --production --frozen-lockfile --no-default-rc
else
echo "yarn.lock file not present, not running in development mode. use npm to install code-server!"
exit 1
fi
yarn --production --frozen-lockfile --no-default-rc
;;
*)
echo "Could not determine which package manager is being used to install code-server"
Expand Down