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