Skip to content

Release

Release #2

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
version:
required: true
description: The version to use when creating the release
type: string
prerelease:
required: true
description: Whether this release is a preview
type: boolean
default: true
jobs:
build:
uses: ./.github/workflows/test.yml
windows-build:
name: Windows Build
runs-on: windows-latest
needs: [build]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.x
- name: Build Windows x64
run: dotnet publish -c Release -r win-x64 -p:CompilationMode=aot -p:Version=${{ inputs.version }} --self-contained -o publish\win-x64\ src/Host/Loretta.Retargeting.Host.csproj
- name: Build Other Windows Releases
run: |
dotnet publish -c Release -r win-arm64 -p:Version=${{ inputs.version }} --self-contained -o publish\win-arm64\ src/Host/Loretta.Retargeting.Host.csproj
dotnet publish -c Release -r win-x86 -p:Version=${{ inputs.version }} --self-contained -o publish\win-x86\ src/Host/Loretta.Retargeting.Host.csproj
- name: Create Artifacts
run: |
Compress-Archive -Path publish\win-x64\* -DestinationPath publish\lua-retarget_win_x64.zip
Compress-Archive -Path publish\win-x86\* -DestinationPath publish\lua-retarget_win_x86.zip
Compress-Archive -Path publish\win-arm64\* -DestinationPath publish\lua-retarget_win_arm64.zip
- uses: actions/upload-artifact@v4
with:
name: windows-files
path: |
publish/*.zip
linux-build:
name: Linux Build
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.x
- name: Install Compilation dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends clang zlib1g-dev
- name: Build Linux x64
run: dotnet publish -c Release -r linux-x64 -p:CompilationMode=aot -p:Version=${{ inputs.version }} --self-contained -o publish/linux-x64/ src/Host/Loretta.Retargeting.Host.csproj
- name: Build Other Unix Releases
run: |
dotnet publish -c Release -r linux-arm64 -p:Version=${{ inputs.version }} --self-contained -o publish/linux-arm64/ src/Host/Loretta.Retargeting.Host.csproj
dotnet publish -c Release -r osx-x64 -p:Version=${{ inputs.version }} --self-contained -o publish/osx-x64/ src/Host/Loretta.Retargeting.Host.csproj
dotnet publish -c Release -r osx-arm64 -p:Version=${{ inputs.version }} --self-contained -o publish/osx-arm64/ src/Host/Loretta.Retargeting.Host.csproj
- name: Create Artifacts
run: |
for rid in "linux-x64" "linux-arm64" "osx-x64" "osx-arm64"; do
zip -r "publish/lua-retarget_${rid//-/_}.zip" "publish/$rid/"
tar czf "publish/lua-retarget_${rid//-/_}.tar.gz" "publish/$rid/"
done
- uses: actions/upload-artifact@v4
with:
name: linux-files
path: |
publish/*.zip
publish/*.tar.gz
release:
name: Release
runs-on: ubuntu-latest
needs:
- windows-build
- linux-build
steps:
- name: Download Windows Builds
uses: actions/download-artifact@v4
with:
name: windows-files
path: artifacts
- uses: actions/download-artifact@v4
with:
name: linux-files
path: artifacts
- name: Create Release
uses: softprops/action-gh-release@v1
with:
name: v${{ inputs.version }}
tag_name: v${{ inputs.version }}
prerelease: ${{ inputs.prerelease }}
files: |
artifacts/*.zip
artifacts/*.tar.gz