Skip to content

Changes for release process #1534

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 6 commits into from
May 6, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ jobs:
echo "Created bundle $name"
mv "$file" "$name"
done
git config --global --add safe.directory $PWD
git rev-parse HEAD > vscode-swift-sha.txt
- name: Archive production artifacts
id: archive
uses: actions/upload-artifact@v4
Expand All @@ -41,6 +43,7 @@ jobs:
name: vscode-swift-extension
path: |
*.vsix
vscode-swift-sha.txt

tests_release:
name: Test Release
Expand Down
43 changes: 42 additions & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,51 @@ on:
types: [opened, reopened, synchronize]

jobs:
package:
name: Package Extension
runs-on: ubuntu-latest
container:
image: swift:6.0-jammy
outputs:
artifact-id: ${{ steps.archive.outputs.artifact-id }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build Extension
run: |
export NODE_VERSION=v20.18.2
export NODE_PATH=/usr/local/nvm/versions/node/v20.18.2/bin
export NVM_DIR=/usr/local/nvm
. .github/workflows/scripts/setup-linux.sh
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
npm ci
npm run compile
Copy link
Member

Choose a reason for hiding this comment

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

This compile step is not necessary: npm run package already does a compile.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will fix

npm run package
npm run preview-package
for file in *.vsix; do
name="$(basename "$file" .vsix)-${{github.run_number}}.vsix"
echo "Created bundle $name"
mv "$file" "$name"
done
git config --global --add safe.directory $PWD
git rev-parse HEAD > vscode-swift-sha.txt
- name: Archive production artifacts
id: archive
uses: actions/upload-artifact@v4
if: ${{ env.ACT != 'true' }}
with:
if-no-files-found: error
name: vscode-swift-extension
path: |
*.vsix
vscode-swift-sha.txt

tests:
name: ${{ contains(github.event.pull_request.labels.*.name, 'full-test-run') && 'Full Test Run' || 'Test'}}
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
needs: package
with:
needs_token: true
# Linux
linux_exclude_swift_versions: '[{"swift_version": "nightly-6.1"},{"swift_version": "nightly-main"}]'
linux_env_vars: |
Expand All @@ -24,7 +65,7 @@ jobs:
windows_env_vars: |
CI=1
FAST_TEST_RUN=${{ contains(github.event.pull_request.labels.*.name, 'full-test-run') && '0' || '1'}}
windows_pre_build_command: .github\workflows\scripts\windows\install-nodejs.ps1
windows_pre_build_command: .github\workflows\scripts\windows\setup.ps1
windows_build_command: scripts\test_windows.ps1
enable_windows_docker: false

Expand Down
20 changes: 20 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1676,6 +1676,7 @@
"@types/chai": "^4.3.19",
"@types/chai-as-promised": "^7.1.8",
"@types/chai-subset": "^1.3.6",
"@types/decompress": "^4.2.7",
"@types/glob": "^7.1.6",
"@types/lcov-parse": "^1.0.2",
"@types/lodash.debounce": "^4.0.9",
Expand Down
18 changes: 14 additions & 4 deletions scripts/download_vsix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,21 @@ const repo = repository.split("/")[1];
const files = await decompress("artifacts.zip", process.cwd());
console.log(`Downloaded artifact(s): ${files.map(f => f.path).join(", ")}`);
const newName = process.env["VSCODE_SWIFT_VSIX"] || "vscode-swift.vsix";
await rename(files[0].path, newName);
console.log(`Renamed artifact: ${files[0].path} => ${newName}`);
const releaseVSIX = files.find(f => /swift-vscode-\d.\d.\d-\d+.vsix/m.test(f.path));
if (!releaseVSIX) {
console.error("Cound not find vscode-swift release VSIX in artifact bundle");
process.exit(1);
}
await rename(releaseVSIX.path, newName);
const prereleaseVSIX = files.find(f => /swift-vscode-\d.\d.\d{8}-\d+.vsix/m.test(f.path));
if (!prereleaseVSIX) {
console.error("Cound not find vscode-swift pre-release VSIX in artifact bundle");
process.exit(1);
}
console.log(`Renamed artifact: ${releaseVSIX.path} => ${newName}`);
const preNewName =
process.env["VSCODE_SWIFT_PRERELEASE_VSIX"] || "vscode-swift-prerelease.vsix";
await rename(files[1].path, preNewName);
console.log(`Renamed artifact: ${files[1].path} => ${preNewName}`);
await rename(prereleaseVSIX.path, preNewName);
console.log(`Renamed artifact: ${prereleaseVSIX.path} => ${preNewName}`);
await unlink("artifacts.zip");
})();
1 change: 0 additions & 1 deletion scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ cd /tmp/code
npm ci
npm run lint
npm run format
npm run package
npm run soundness -- --force-run

xvfb-run -a npm run coverage 2>&1 | grep -Ev "Failed to connect to the bus|GPU stall due to ReadPixels"
Expand Down