Skip to content

Commit

Permalink
Autobuild and upload program when a release published
Browse files Browse the repository at this point in the history
  • Loading branch information
firejox committed Oct 11, 2022
1 parent d4a331b commit db7cda5
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
31 changes: 31 additions & 0 deletions .github/workflows/publish-executable-on-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish Executable on Release

on:
release:
types: [published]

jobs:
build_and_publish:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Setup .Net 6.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0'
- name: Install dependencies
run: dotnet restore
- name: Publish program into build folder
run: dotnet publish winsocat -c Release -o build
- name: Zip build folder
run: 7z a -tzip winsocat.zip build
- name: Upload program
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
upload_url: ${{github.event.release.upload_url}}
asset_path: ./winsocat.zip
asset_name: winsocat.zip
asset_content_type: application/zip

3 changes: 2 additions & 1 deletion .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ jobs:
- name: Build
run: dotnet build --no-restore
- name: Run unit tests
run: dotnet test --no-build
run: dotnet test --no-build

0 comments on commit db7cda5

Please sign in to comment.