Ensure results are cleared if query is empty #46
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Release | |
on: | |
push: | |
tags: | |
- "*" | |
jobs: | |
create_release: | |
name: Create New Release | |
runs-on: windows-2019 | |
steps: | |
- name: Install 7Zip PowerShell Module | |
shell: powershell | |
run: Install-Module 7Zip4PowerShell -Force | |
- name: Setup .NET SDK | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '7.0.x' | |
- uses: actions/checkout@v2 | |
- name: Extract Tag Version | |
id: get_version | |
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} | |
shell: bash | |
- name: Restore Packages | |
run: dotnet restore | |
- name: Build Artifacts | |
run: | | |
dotnet publish -c Release Pinpoint.Win/Pinpoint.Win.csproj -o ./a -r win-x64 --self-contained false -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true | |
dotnet publish -c Release Pinpoint.Win/Pinpoint.Win.csproj -o ./b -r win-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeAllContentForSelfExtract=true | |
- name: Zip Artifacts | |
run: | | |
7z a -tzip Pinpoint-${{ steps.get_version.outputs.VERSION }}.zip ./a/Pinpoint.exe | |
7z a -tzip Pinpoint-Standalone-${{ steps.get_version.outputs.VERSION }}.zip ./b/Pinpoint.exe | |
- name: Create GitHub Release | |
if: ${{ !env.ACT }} | |
id: create_release | |
uses: actions/create-release@latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ github.ref }} | |
draft: false | |
prerelease: true | |
- name: Upload Release Asset (self-contained) | |
if: ${{ !env.ACT }} | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./Pinpoint-Standalone-${{ steps.get_version.outputs.VERSION }}.zip | |
asset_name: Pinpoint-Standalone-${{ steps.get_version.outputs.VERSION }}.zip | |
asset_content_type: application/zip | |
- name: Upload Release Asset (not self-contained) | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./Pinpoint-${{ steps.get_version.outputs.VERSION }}.zip | |
asset_name: Pinpoint-${{ steps.get_version.outputs.VERSION }}.zip | |
asset_content_type: application/zip | |
- name: Prepare Chocolatey | |
uses: crazy-max/ghaction-chocolatey@v2 | |
with: | |
args: apikey --key ${{ secrets.CHOCOLATEY_API_KEY }} --source https://push.chocolatey.org/ | |
- name: Overwrite version in Nuspec | |
shell: bash | |
run: | | |
sed -i "s/<version>.*<\/version>/<version>${{ steps.get_version.outputs.VERSION }}<\/version>/g" Pinpoint.nuspec | |
- name: Package and push to Chocolatey | |
run: | | |
choco pack | |
choco push Pinpoint.${{ steps.get_version.outputs.VERSION }}.nupkg --source https://push.chocolatey.org/ |