Skip to content

Commit

Permalink
Create dotnet-build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jteijema committed Feb 27, 2024
1 parent 39ab07a commit 4a93866
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/dotnet-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: .NET Build and Package

on:
push:
branches:
- main

jobs:
build:
runs-on: windows-latest

steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: '6.0' # Specify your .NET version here

- name: Restore dependencies
run: dotnet restore Community.PowerToys.Run.Plugin.BitwardenPlugin/Community.PowerToys.Run.Plugin.BitwardenPlugin.csproj

- name: Build
run: dotnet build Community.PowerToys.Run.Plugin.BitwardenPlugin/Community.PowerToys.Run.Plugin.BitwardenPlugin.csproj --configuration Release --no-restore

- name: Publish
run: dotnet publish Community.PowerToys.Run.Plugin.BitwardenPlugin/Community.PowerToys.Run.Plugin.BitwardenPlugin.csproj -c Release -o out

- name: Zip Artifact
uses: actions/upload-artifact@v3
with:
name: bitwarden-plugin
path: Community.PowerToys.Run.Plugin.BitwardenPlugin/out/**

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref_name }}
draft: false
prerelease: false

- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./Community.PowerToys.Run.Plugin.BitwardenPlugin/out/bitwarden-plugin.zip
asset_name: bitwarden-plugin.zip
asset_content_type: application/zip

0 comments on commit 4a93866

Please sign in to comment.