release syntax #29
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
name: dotnet-release | |
on: | |
push: | |
tags: | |
- v** | |
env: | |
dotnet-version: '8.0.x' | |
jobs: | |
win-x64-release: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ env.dotnet-version }} | |
- name: Install project dependencies | |
run: dotnet restore | |
- run: mkdir \app | |
- name: Compile exectuable | |
run: dotnet publish -r win-x64 -c Release -o \app\ CloseAsteroids.csproj | |
- name: Zip executable | |
shell: Powershell | |
run: Compress-Archive -Path D:\app\ -Destination win-x64.zip | |
- name: Upload windows zip artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: win-x64.zip | |
path: win-x64.zip | |
macos-x64-release: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ env.dotnet-version }} | |
- name: Install project dependencies | |
run: dotnet restore | |
- run: sudo mkdir -p ~/app | |
- name: Compile exectuable | |
run: sudo dotnet publish -r osx-x64 -c Release -o ~/app/ CloseAsteroids.csproj | |
- name: Zip executable | |
shell: Powershell | |
run: Compress-Archive -Path ~/app/* -Destination macos-x64.zip | |
- name: Upload macos zip artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: macos-x64.zip | |
path: macos-x64.zip | |
linux-x64-release: | |
runs-on: ubuntu-latest | |
needs: [ win-x64-release, macos-x64-release ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ env.dotnet-version }} | |
- name: Install project dependencies | |
run: dotnet restore | |
- name: Install dotnet AOT dependencies | |
run: | | |
sudo apt-get update \ | |
&& sudo apt-get install -y --no-install-recommends \ | |
clang zlib1g-dev | |
- run: sudo mkdir ~/app | |
- name: Compile exectuable | |
run: sudo dotnet publish -r linux-x64 -c Release -o ~/app/ CloseAsteroids.csproj | |
- name: Zip executable | |
run: zip -r linux-x64.zip ~/app/ | |
- name: Download All Artifacts | |
uses: actions/download-artifact@v4 | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
name: ${{ github.ref_name }} | |
token: ${{ secrets.RELEASE_TOKEN }} | |
generate_release_notes: true | |
files: | | |
*/*.zip | |
- name: Delete artifacts | |
uses: geekyeggo/delete-artifact@v5 | |
if: always() | |
with: | |
name: | | |
win-x64.zip | |
macos-x64.zip |