.NET #17
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
# This workflow will build a .NET project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | |
name: .NET | |
permissions: | |
contents: write | |
on: | |
release: | |
types: ["published"] | |
jobs: | |
build-linux: | |
env: | |
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Set up butler | |
uses: jdno/[email protected] | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Publish | |
run: dotnet publish -c Release -o ./release ./Pong.Desktop/Pong.Desktop.csproj | |
- name: Create tar.gz package | |
run: | | |
tar -czvf linux-universal.tar.gz ./release | |
butler push linux-universal.tar.gz yesseruser/pong:linux-x64 | |
- name: Publish linux to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
file: linux-universal.tar.gz | |
build-windows: | |
runs-on: windows-latest | |
env: | |
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Set up butler | |
uses: jdno/[email protected] | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Publish | |
run: dotnet publish -c Release -o ./release --self-contained ./Pong.Desktop/Pong.Desktop.csproj | |
- name: Create zip package | |
run: | | |
7z a windows-x64.zip .\release\* | |
butler push windows-x64.zip yesseruser/pong:win64 | |
- name: Publish windows to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
file: windows-x64.zip | |
build-mac: | |
runs-on: [self-hosted, macOS, ARM64] | |
env: | |
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Set up butler | |
run: | | |
curl -L -o butler.zip https://broth.itch.zone/butler/darwin-amd64/LATEST/archive/default | |
unzip -d butler butler.zip | |
chmod +x ./butler/butler | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Publish | |
run: dotnet publish -c Release -o ./release -p:PublishSingleFile=True ./Pong.Desktop/Pong.Desktop.csproj | |
- name: Move files to app bundle | |
run: | | |
mkdir -p ./mac-bundle/Contents/Resources/Content | |
mv ./release/Content/* ./mac-bundle/Contents/Resources/Content | |
rm -rf ./release/Content | |
mv ./release/* ./mac-bundle/Contents/MacOS | |
mv ./mac-bundle ./Pong.app | |
./butler/butler push ./Pong.app yesseruser/pong:mac-arm64 | |
- name: Archive app bundle | |
run: tar -cvzf mac-arm64.app.tar.gz ./Pong.app | |
- name: Publish Mac to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
file: mac-arm64.app.tar.gz | |