oops 11 #23
Workflow file for this run
This file contains hidden or 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: Publish | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
release: | |
name: Create Release | |
runs-on: ubuntu-latest | |
permissions: write-all | |
outputs: | |
release: ${{ steps.release.outputs.upload_url }} | |
version: ${{ steps.version.outputs.version-without-v }} | |
steps: | |
- name: Get Version | |
uses: battila7/get-version-action@v2.2.1 | |
id: version | |
- name: Create Release | |
uses: actions/create-release@v1 | |
id: release | |
env: | |
GITHUB_TOKEN: ${{ secrets.github_token }} | |
with: | |
tag_name: ${{ steps.version.outputs.version }} | |
release_name: TotK Mod Manager - ${{ steps.version.outputs.version }} | |
body: | | |
> [!IMPORTANT] | |
> The latest [.NET runtime](https://dotnet.microsoft.com/en-us/download/dotnet/latest) from [Microsoft](https://dotnet.microsoft.com/en-us/) is required on all operating systems, make sure you download and install that before proceeding. | |
build: | |
needs: release | |
permissions: write-all | |
name: ${{ matrix.target.project }} on ${{ matrix.config.name }} | |
runs-on: ${{ matrix.config.os }} | |
strategy: | |
fail-fast: true | |
matrix: | |
target: | |
- project: Tkmm | |
config: | |
- name: Windows (x64) | |
os: ubuntu-latest | |
runtime: win-x64 | |
runtime_name: win-x64 | |
extension: .exe | |
- name: Windows (arm64) | |
os: ubuntu-latest | |
runtime: win-arm64 | |
runtime_name: win-arm64 | |
extension: .exe | |
- name: Linux (x64) | |
os: ubuntu-latest | |
runtime: linux-x64 | |
runtime_name: linux-x64 | |
extension: ~ | |
- name: Linux (arm64) | |
os: ubuntu-latest | |
runtime: linux-arm64 | |
runtime_name: linux-arm64 | |
extension: ~ | |
- name: Switch (arm64) | |
os: ubuntu-latest | |
runtime: linux-arm64 | |
runtime_name: linux-nx | |
flags: "-p:IsSwitch=true" | |
extension: ~ | |
- name: MacOS (x64) | |
os: ubuntu-latest | |
runtime: osx-x64 | |
runtime_name: osx-x64 | |
extension: ~ | |
- name: MacOS (arm64) | |
os: ubuntu-latest | |
runtime: osx-arm64 | |
runtime_name: osx-arm64 | |
extension: ~ | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4.1.1 | |
with: | |
submodules: true | |
- name: Setup .NET SDK | |
uses: actions/setup-dotnet@v4.0.0 | |
with: | |
dotnet-version: "9.x.x" | |
- name: Build | |
shell: bash | |
run: | | |
dotnet publish src/${{ matrix.target.project }} \ | |
-c Release \ | |
-o ${{ matrix.target.project }}-${{ matrix.config.runtime }} \ | |
-r ${{ matrix.config.runtime }} \ | |
--sc ${{ matrix.config.runtime != 'linux-nx' }} \ | |
--version-suffix ${{ needs.release.outputs.version }} \ | |
-p:Version=${{ needs.release.outputs.version }} ${{ matrix.config.flags }} \ | |
-p:DebugType=embedded | |
- name: Archive Build | |
uses: TheDoctor0/zip-release@0.7.6 | |
with: | |
type: zip | |
filename: ../${{ matrix.target.project }}-${{ matrix.config.runtime }}.zip | |
directory: ${{ matrix.target.project }}-${{ matrix.config.runtime }} | |
path: ./** | |
- name: Create Checksum File | |
shell: bash | |
run: | | |
md5=($(md5sum -b ${{ matrix.target.project }}-${{ matrix.config.runtime }}.zip)) | |
echo $md5 > ${{ matrix.target.project }}-${{ matrix.config.runtime }}.zip.checksum | |
- name: Upload Release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.github_token }} | |
with: | |
upload_url: ${{ needs.release.outputs.release }} | |
asset_path: ${{ matrix.target.project }}-${{ matrix.config.runtime }}.zip | |
asset_name: ${{ matrix.target.project }}-${{ matrix.config.runtime_name }}.zip | |
asset_content_type: application/zip | |
- name: Upload Release Checksum | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.github_token }} | |
with: | |
upload_url: ${{ needs.release.outputs.release }} | |
asset_path: ${{ matrix.target.project }}-${{ matrix.config.runtime }}.zip.checksum | |
asset_name: ${{ matrix.target.project }}-${{ matrix.config.runtime_name }}.zip.checksum | |
asset_content_type: application/zip | |
appimage: | |
needs: release | |
runs-on: ubuntu-latest | |
permissions: write-all | |
name: AppImage for ${{ matrix.target.project }} on ${{ matrix.config.name }} | |
strategy: | |
fail-fast: true | |
matrix: | |
target: | |
- project: Tkmm | |
config: | |
- name: Linux (x64) | |
os: ubuntu-latest | |
runtime: linux-x64 | |
extension: ~ | |
- name: Linux (arm64) | |
os: ubuntu-latest | |
runtime: linux-arm64 | |
extension: ~ | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4.1.1 | |
with: | |
submodules: true | |
- name: Setup .NET SDK | |
uses: actions/setup-dotnet@v4.0.0 | |
with: | |
dotnet-version: "9.x.x" | |
- name: Build | |
shell: bash | |
run: | | |
dotnet publish src/${{ matrix.target.project }} \ | |
-c Release \ | |
-o ${{ matrix.target.project }}-${{ matrix.config.runtime }} \ | |
-r ${{ matrix.config.runtime }} \ | |
--sc true \ | |
--version-suffix ${{ needs.release.outputs.version }} \ | |
-p:Version=${{ needs.release.outputs.version }} \ | |
-p:NoUpdate=true \ | |
-p:DebugType=embedded | |
- name: Build AppImage | |
shell: bash | |
run: | | |
# Setup appimagetool | |
mkdir -p tools | |
wget -q -O tools/appimagetool "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage" | |
chmod +x tools/appimagetool | |
rm -rf AppDir | |
mkdir -p AppDir/usr/bin | |
cp distribution/appimage/Tkmm.desktop AppDir/Tkmm.desktop | |
cp distribution/appimage/AppRun AppDir/AppRun | |
cp distribution/appimage/tkmm.svg AppDir/tkmm.svg | |
cp -R ${{ matrix.target.project }}-${{ matrix.config.runtime }}/* AppDir/usr/bin/ | |
chmod +x AppDir/AppRun AppDir/usr/bin/${{ matrix.target.project }}* | |
# Set $ARCH for appimagetool based on the runtime | |
if [ "${{ matrix.config.runtime }}" = "linux-x64" ]; then | |
ARCH_NAME=x64 | |
export ARCH=x86_64 | |
elif [ "${{ matrix.config.runtime }}" = "linux-arm64" ]; then | |
ARCH_NAME=arm64 | |
export ARCH=aarch64 | |
else | |
echo "Unexpected runtime ${{ matrix.config.runtime }}" | |
exit 1 | |
fi | |
export UFLAG="gh-releases-zsync|${{ github.repository_owner }}|${{ github.event.repository.name }}|latest|*-$ARCH_NAME.AppImage.zsync" | |
./tools/appimagetool --comp zstd --mksquashfs-opt -Xcompression-level --mksquashfs-opt 21 -u "$UFLAG" AppDir | |
mv ./*.AppImage ${{ matrix.target.project }}-${{ matrix.config.runtime }}.AppImage | |
- name: Upload AppImage | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.github_token }} | |
with: | |
upload_url: ${{ needs.release.outputs.release }} | |
asset_path: ${{ matrix.target.project }}-${{ matrix.config.runtime }}.AppImage | |
asset_name: ${{ matrix.target.project }}-${{ matrix.config.runtime }}.AppImage | |
asset_content_type: application/octet-stream |