Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/dotnet-desktop.yml
  • Loading branch information
mateusz-kierepka-hl committed Sep 25, 2024
2 parents 114465b + fb5422a commit 8fade4d
Showing 1 changed file with 38 additions and 9 deletions.
47 changes: 38 additions & 9 deletions .github/workflows/dotnet-desktop.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: Build and Release ChatAAC

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ${{ matrix.os }}
Expand All @@ -19,35 +21,59 @@ jobs:
rid: osx-x64
- os: windows-latest
rid: win-x64

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'

- name: Check .NET version
run: dotnet --version

- name: Restore dependencies
run: dotnet restore
- name: Build self-contained app
run: dotnet publish --configuration Release -r ${{ matrix.rid }} --self-contained -p:PublishSingleFile=true -p:PublishTrimmed=true
- name: List files in publish directory
run: ls -R bin/Release/net8.0/${{ matrix.rid }}/publish/

- name: Build project
run: dotnet build --configuration Release

- name: Publish self-contained app
run: dotnet publish --configuration Release -r ${{ matrix.rid }} --self-contained -o ./publish

- name: List contents of publish directory
run: |
if [ "${{ runner.os }}" == "Windows" ]; then
dir publish
else
ls -R publish
fi
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ChatAAC-${{ matrix.os }}
path: bin/Release/net8.0/${{ matrix.rid }}/publish/
path: publish/

release:
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Download all artifacts
uses: actions/download-artifact@v3
with:
path: artifacts

- name: Display structure of downloaded files
run: ls -R
run: ls -R artifacts

- name: Create Release
id: create_release
uses: actions/create-release@v1
Expand All @@ -64,30 +90,33 @@ jobs:
- [macOS](https://github.com/${{ github.repository }}/releases/download/v1.0.${{ github.run_number }}/ChatAAC-macos-x64)
draft: false
prerelease: false

- name: Upload Release Asset (Linux)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./bin/Release/net8.0/linux-x64/publish/ChatAAC
asset_path: ./artifacts/ChatAAC-ubuntu-latest/ChatAAC
asset_name: ChatAAC-linux-x64
asset_content_type: application/octet-stream

- name: Upload Release Asset (Windows)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./bin/Release/net8.0/win-x64/publish/ChatAAC.exe
asset_path: ./artifacts/ChatAAC-windows-latest/ChatAAC.exe
asset_name: ChatAAC-windows-x64.exe
asset_content_type: application/octet-stream

- name: Upload Release Asset (macOS)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./bin/Release/net8.0/osx-x64/publish/ChatAAC
asset_path: ./artifacts/ChatAAC-macos-latest/ChatAAC
asset_name: ChatAAC-macos-x64
asset_content_type: application/octet-stream

0 comments on commit 8fade4d

Please sign in to comment.