Skip to content

Commit 0ad2a79

Browse files
committed
Archive the commit SHA used to package the VSIX
Eventually will be used downstream to tag releases Also setup PR job to package the VSIX and run tests against it so we can test against that in verifier jobs as well
1 parent a0df974 commit 0ad2a79

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

.github/workflows/nightly.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ jobs:
3232
echo "Created bundle $name"
3333
mv "$file" "$name"
3434
done
35+
git rev-parse HEAD > vscode-swift-sha.txt
3536
- name: Archive production artifacts
3637
id: archive
3738
uses: actions/upload-artifact@v4
@@ -41,6 +42,7 @@ jobs:
4142
name: vscode-swift-extension
4243
path: |
4344
*.vsix
45+
vscode-swift-sha.txt
4446
4547
tests_release:
4648
name: Test Release

.github/workflows/pull_request.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,48 @@ on:
55
types: [opened, reopened, synchronize]
66

77
jobs:
8+
package:
9+
name: Package Extension
10+
runs-on: ubuntu-latest
11+
container:
12+
image: swift:6.0-jammy
13+
outputs:
14+
artifact-id: ${{ steps.archive.outputs.artifact-id }}
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
- name: Build Extension
19+
run: |
20+
export NODE_VERSION=v20.18.2
21+
export NODE_PATH=/usr/local/nvm/versions/node/v20.18.2/bin
22+
export NVM_DIR=/usr/local/nvm
23+
. .github/workflows/scripts/setup-linux.sh
24+
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
25+
npm ci
26+
npm run compile
27+
npm run package
28+
npm run preview-package
29+
for file in *.vsix; do
30+
name="$(basename "$file" .vsix)-${{github.run_number}}.vsix"
31+
echo "Created bundle $name"
32+
mv "$file" "$name"
33+
done
34+
git rev-parse HEAD > vscode-swift-sha.txt
35+
- name: Archive production artifacts
36+
id: archive
37+
uses: actions/upload-artifact@v4
38+
if: ${{ env.ACT != 'true' }}
39+
with:
40+
if-no-files-found: error
41+
name: vscode-swift-extension
42+
path: |
43+
*.vsix
44+
vscode-swift-sha.txt
45+
846
tests:
947
name: ${{ contains(github.event.pull_request.labels.*.name, 'full-test-run') && 'Full Test Run' || 'Test'}}
1048
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
49+
needs: package
1150
with:
1251
# Linux
1352
linux_exclude_swift_versions: '[{"swift_version": "nightly-6.1"},{"swift_version": "nightly-main"}]'
@@ -17,13 +56,18 @@ jobs:
1756
NVM_DIR=/usr/local/nvm
1857
CI=1
1958
FAST_TEST_RUN=${{ contains(github.event.pull_request.labels.*.name, 'full-test-run') && '0' || '1'}}
59+
VSCODE_SWIFT_VSIX_ID=${{needs.package.outputs.artifact-id}}
60+
GITHUB_REPOSITORY=${{github.repository}}
2061
linux_pre_build_command: . .github/workflows/scripts/setup-linux.sh
2162
linux_build_command: ./scripts/test.sh
2263
# Windows
2364
windows_exclude_swift_versions: '[{"swift_version": "nightly-6.1"},{"swift_version": "nightly"}]'
2465
windows_env_vars: |
2566
CI=1
2667
FAST_TEST_RUN=${{ contains(github.event.pull_request.labels.*.name, 'full-test-run') && '0' || '1'}}
68+
VSCODE_SWIFT_VSIX_ID=${{needs.package.outputs.artifact-id}}
69+
VSCODE_SWIFT_VSIX=vscode-swift.vsix
70+
GITHUB_REPOSITORY=${{github.repository}}
2771
windows_pre_build_command: .github\workflows\scripts\windows\install-nodejs.ps1
2872
windows_build_command: scripts\test_windows.ps1
2973
enable_windows_docker: false

0 commit comments

Comments
 (0)