Skip to content
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
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build-and-test:
runs-on: windows-latest
if: "!startsWith(github.event.head_commit.message, 'chore(release):')"

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'

- name: Restore dependencies
run: dotnet restore VStudio.slnx

- name: Build
run: dotnet build VStudio.slnx --no-restore

- name: Test
run: dotnet test VStudio.slnx --no-build
37 changes: 37 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish to NuGet

on:
push:
tags: ['v*']

jobs:
publish:
runs-on: windows-latest

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'

- name: Restore dependencies
run: dotnet restore VStudio.slnx

- name: Build
run: dotnet build VStudio.slnx --no-restore

- name: Test
run: dotnet test VStudio.slnx --no-build

- name: Extract version from tag
id: version
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
shell: bash

- name: Pack
run: dotnet pack src/VStudio.CLI/VStudio.CLI.csproj --no-build -p:Version=${{ steps.version.outputs.VERSION }} -o ./nupkg

- name: Push to NuGet
run: dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release

on:
push:
branches: [main]

jobs:
release:
runs-on: windows-latest
if: "!startsWith(github.event.head_commit.message, 'chore(release):')"

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_PAT }}

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'

- name: Install Versionize
run: dotnet tool install --global Versionize

- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

- name: Run Versionize
id: versionize
run: versionize --skip-dirty
continue-on-error: true

- name: Push changes
if: steps.versionize.outcome == 'success'
run: git push --follow-tags
8 changes: 8 additions & 0 deletions .versionize
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"projects": [
{
"name": "VStudio.CLI",
"path": "src/VStudio.CLI/VStudio.CLI.csproj"
}
]
}
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# vstudio

A .NET global tool that opens Visual Studio solution files from the command line.

## Installation

```
dotnet tool install --global vstudio
```

## Usage

```
vstudio . # find and open a solution in the current directory
vstudio ./path/to/dir # find and open a solution in a given directory
vstudio ./path/to/MyApp.sln # open a specific solution file directly
```

## Uninstall

```
dotnet tool uninstall --global vstudio
```
22 changes: 21 additions & 1 deletion src/VStudio.CLI/VStudio.CLI.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<!-- Global tool packaging -->
<PackAsTool>true</PackAsTool>
<ToolCommandName>vstudio</ToolCommandName>
<PackageOutputPath>./nupkg</PackageOutputPath>

<!-- NuGet metadata -->
<PackageId>vstudio</PackageId>
<Version>0.1.0</Version>
<Authors>dulait</Authors>
<Description>A .NET global tool that opens Visual Studio solution files from the command line.</Description>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageTags>visual-studio;cli;developer-tools;dotnet-tool</PackageTags>
<PackageProjectUrl>https://github.com/dulait/vstudio</PackageProjectUrl>
<RepositoryUrl>https://github.com/dulait/vstudio</RepositoryUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup>
Expand All @@ -15,4 +31,8 @@
<PackageReference Include="Spectre.Console" Version="0.49.*" />
</ItemGroup>

<ItemGroup>
<None Include="..\..\README.md" Pack="true" PackagePath="/" />
</ItemGroup>

</Project>