Skip to content

Publish

Publish #6

name: Publish
permissions:
contents: write
on:
pull_request:
branches:
- main
types:
- closed
workflow_dispatch:
jobs:
build:
if: ${{ github.event_name == 'workflow_dispatch' || github.event.pull_request.merged }}
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Get version
id: version
uses: notiz-dev/github-action-json-property@release
with:
path: 'Lorem Ipsum C#/plugin.json'
prop_path: 'Version'
- run: echo ${{steps.version.outputs.prop}}
- name: Restore dependencies
run: dotnet restore
- name: Build
run: |
cd "Lorem Ipsum C#"
dotnet publish -c Release -r win-x64 --no-self-contained "Lorem Ipsum C#.csproj"
7z a -tzip "Flow.Launcher.Plugin.LoremIpsumGenerator.zip" "./bin/Debug/*"
- name: Publish
uses: softprops/action-gh-release@v1
with:
files: "Flow.Launcher.Plugin.LoremIpsumGenerator/Flow.Launcher.Plugin.LoremIpsumGenerator.zip"
tag_name: "v${{steps.version.outputs.prop}}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}