Skip to content

Commit

Permalink
ci: Update release
Browse files Browse the repository at this point in the history
  • Loading branch information
34j committed Nov 4, 2022
1 parent 050a919 commit 066050e
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 17 deletions.
58 changes: 42 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,48 @@
name: auto-merge
name: "Publish"

on: pull_request_target
permissions:
pull-requests: write
contents: write
on:
push:
tags:
- "*"

env:
PROJECT_PATH: ZoomCloser/ZoomCloser.csproj
ZIP_PATH: ZoomCloser/bin/publish/ZoomCloser.zip
EXE_PATH: ZoomCloser/bin/publish/ZoomCloser.exe
LICENSES_PATH: ZoomCloser/bin/publish/LICENSES.md


jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
deploy:
runs-on: windows-latest
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/[email protected]
- name: Initialize Actions
uses: actions/checkout@v2

- name: Restore Project
run: dotnet restore ${{ env.PROJECT_PATH }}

- name: Publish Project
run: dotnet publish ${{ env.PROJECT_PATH }} -c Release --self-contained -r win-x64 -p:PublishSingleFile=true --no-restore

- name: Create Zip File
uses: papeloto/action-zip@v1
with:
github-token: '${{ secrets.GITHUB_TOKEN }}'
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --squash "$PR_URL"
files: ${{ env.EXE_PATH }}
dest: ${{ env.ZIP_PATH }} ${{ env.LICENSES_PATH }}

- name: Initialize Release
uses: actions/create-release@v1
id: create_release
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}

- name: Create Release
uses: csexton/release-asset-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.ZIP_PATH }}
release-url: ${{ steps.create_release.outputs.upload_url }}
2 changes: 1 addition & 1 deletion ZoomCloser/ZoomCloser.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
</Compile>
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(PublishProtocol)'!=''">
<Exec Command="del &quot;$(TargetDir)*.xml&quot;&#xD;&#xA;del &quot;$(TargetDir)*.pdb&quot;&#xD;&#xA;dotnet-project-licenses -i &quot;./&quot; -t -u -m --outfile &quot;$(TargetDir)LICENSES.md&quot;" />
<Exec Command="del &quot;$(PublishDir)/*.{pdb,dll,config,xml}&quot;&#xD;&#xA;dotnet-project-licenses -i &quot;./&quot; -t -u -m --outfile &quot;$(PublishDir)/LICENSES.md&quot;" />
</Target>
</Project>

0 comments on commit 066050e

Please sign in to comment.