Skip to content

Commit 0402b23

Browse files
authored
feat(ci): Test and Publish in CI (#42)
1 parent 757fdc5 commit 0402b23

File tree

6 files changed

+253
-175
lines changed

6 files changed

+253
-175
lines changed

.github/workflows/ci.yml

Lines changed: 77 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
branches:
77
- "main"
88
pull_request:
9+
release:
10+
types:
11+
- published
912

1013
concurrency:
1114
group: "ci-${{ github.ref_name }}-${{ github.event_name }}-${{ github.event.number || (github.event.pull_request.head.sha || github.sha) }}"
@@ -17,10 +20,20 @@ env:
1720
jobs:
1821

1922
build:
20-
name: "Build"
21-
runs-on: "ubuntu-latest"
23+
name: "Build on ${{ matrix.os }}"
24+
runs-on: ${{ matrix.os }}
25+
2226
timeout-minutes: 30
2327

28+
strategy:
29+
matrix:
30+
os:
31+
- "ubuntu-latest"
32+
- "macos-latest"
33+
34+
outputs:
35+
vsixPath: ${{ steps.package.outputs.vsixPath }}
36+
2437
steps:
2538
- name: "Checkout"
2639
uses: "actions/checkout@v4"
@@ -54,14 +67,73 @@ jobs:
5467
with:
5568
command: "npm run compile"
5669

70+
- name: "Test on MacOS"
71+
if: ${{ matrix.os == 'macos-latest' }}
72+
run: |
73+
npm run test
74+
75+
- name: "Test on Linux"
76+
if: ${{ matrix.os == 'ubuntu-latest' }}
77+
run: |
78+
xvfb-run -a npm test
79+
5780
- name: "Package"
81+
id: "package"
5882
uses: "flox/activate-action@main"
5983
with:
60-
command: "npm run package -- --out flox-main.vsix"
84+
command: "npm run package -- --out flox-latest.vsix"
6185

6286
- name: "Upload vscode extention as artifact"
6387
uses: "actions/upload-artifact@v4"
6488
with:
65-
name: "flox-main.vsix"
66-
path: "flox-main.vsix"
89+
name: "flox-latest-${{ matrix.os }}.vsix"
90+
path: "flox-latest.vsix"
6791
retention-days: 14
92+
93+
publish:
94+
name: "Publish VSCode "
95+
96+
if: ${{ github.event_name == 'release' }}
97+
needs:
98+
- "build"
99+
100+
runs-on: ubuntu-latest
101+
timeout-minutes: 10
102+
103+
steps:
104+
105+
- name: "Checkout"
106+
uses: "actions/checkout@v4"
107+
with:
108+
fetch-depth: 0
109+
110+
- name: "Install Flox"
111+
uses: "flox/install-flox-action@main"
112+
113+
- name: "Restore npm cache"
114+
uses: "actions/cache@v4"
115+
with:
116+
path: |
117+
~/.npm
118+
key: "${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}"
119+
restore-keys: |
120+
${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}-
121+
122+
- name: "Install"
123+
uses: "flox/activate-action@main"
124+
with:
125+
command: "npm ci"
126+
127+
- name: "Download Build Artifact"
128+
uses: actions/download-artifact@v4
129+
with:
130+
name: "flox-latest-ubuntu-latest.vsix"
131+
132+
- name: "Publish to Visual Studio Marketplace"
133+
uses: "flox/activate-action@main"
134+
with:
135+
command: |
136+
vsce publish \
137+
--pat "${{ secrets.MANAGED_VSCODE_MARKETPLACE_TOKEN }}" \
138+
--allow-star-activation \
139+
--pre-release

.vscodeignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ vsc-extension-quickstart.md
1111
**/*.map
1212
**/*.ts
1313
**/.vscode-test.*
14+
scripts/**
1415
!scripts/reopen.sh
16+
assets/**
1517
!assets/icon.png
1618
!assets/icon.svg

README.md

Lines changed: 20 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,23 @@
1-
<h1 align="center">
2-
<a href="https://flox.dev" target="_blank">
3-
<picture>
4-
<source media="(prefers-color-scheme: dark)" srcset="assets/flox-logo-white-on-black.png" />
5-
<source media="(prefers-color-scheme: light)" srcset="assets/flox-logo-black-on-white.png" />
6-
<img src="assets//flox-logo-black-on-white.png" alt="flox logo" />
7-
</picture>
8-
</a>
9-
</h1>
10-
11-
<h2 align="center">
12-
Developer environments you can take with you
13-
</h2>
14-
15-
<h3 align="center">
16-
&emsp;
17-
<a href="https://discourse.flox.dev"><b>Discourse</b></a>
18-
&emsp; | &emsp;
19-
<a href="https://flox.dev/docs"><b>Documentation</b></a>
20-
&emsp; | &emsp;
21-
<a href="https://flox.dev/blog"><b>Blog</b></a>
22-
&emsp; | &emsp;
23-
<a href="https://twitter.com/floxdevelopment"><b>Twitter</b></a>
24-
&emsp; | &emsp;
25-
<a href="https://go.flox.dev/slack"><b>Slack</b></a>
26-
&emsp;
27-
</h3>
28-
29-
[Flox][website] is a virtual environment and package manager all in one. With
30-
Flox you create environments that layer and replace dependencies just where it
31-
matters, making them portable across the full software lifecycle.
32-
33-
`flox-vscode` is a VSCode editor extension that integrates Flox environments
34-
with VSCode.
35-
36-
<!-- TODO: List features (with screenshots) -->
37-
38-
## 🤝 Found a bug? Missing a specific feature?
39-
40-
Feel free to [file a new issue][new-issue] with a respective title and
41-
description on the `flox/flox-vscode` repository. If you already found a
42-
solution to your problem, we would love to review your pull request!
1+
# Bring Flox to VSCode
2+
3+
<img src="./assets/icon.png" align="right" width="128" height="128">
4+
5+
[Flox](https://flox.dev) is a virtual environment and package manager all in
6+
one. With Flox you create environments that layer and replace dependencies just
7+
where it matters, making them portable across the full software lifecycle.
8+
9+
`flox-vscode` is a VSCode extension that integrates Flox environments with
10+
VSCode.
11+
12+
* 📖 Flox documentation can be found [here](https://flox.dev/docs).
13+
* 🚀 Get in touch: [Slack](https://go.flox.dev/slack), [Discourse](https://discourse.flox.dev)
14+
* 🤝 Found a bug? Missing a specific feature? Feel free to [file a new issue][new-issue].
15+
16+
[new-issue]: https://github.com/flox/flox-vscode/issues/new/choose
17+
18+
<p align="center">
19+
<img src="./assets/demo.gif" width="100%" />
20+
</p>
4321

4422
## ⭐️ Contribute
4523

@@ -49,7 +27,3 @@ guide](./CONTRIBUTING.md) first.
4927
## 🪪 License
5028

5129
The Flox CLI is licensed under the GPLv2. See [LICENSE](./LICENSE).
52-
53-
54-
[website]: https://flox.dev
55-
[new-issue]: https://github.com/flox/flox-vscode/issues/new/choose

assets/demo.gif

625 KB
Loading

0 commit comments

Comments
 (0)