From 4a938661f755a55d29647b3f39f05d7b7166e9fe Mon Sep 17 00:00:00 2001 From: Jelle Teijema Date: Tue, 27 Feb 2024 20:30:31 +0100 Subject: [PATCH] Create dotnet-build.yml --- .github/workflows/dotnet-build.yml | 53 ++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/dotnet-build.yml diff --git a/.github/workflows/dotnet-build.yml b/.github/workflows/dotnet-build.yml new file mode 100644 index 0000000..968af29 --- /dev/null +++ b/.github/workflows/dotnet-build.yml @@ -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