mirror of
https://github.com/MAKS-IT-COM/maksit-postclient.git
synced 2026-09-29 19:08:09 +02:00
81 lines
2.4 KiB
YAML
81 lines
2.4 KiB
YAML
name: macOS release assets
|
|
|
|
# GitHub-hosted macos-latest builds Intel and Apple Silicon DMGs.
|
|
# Local Windows release still produces zip / setup / Flatpak; this job attaches Mac assets.
|
|
|
|
on:
|
|
pull_request:
|
|
workflow_dispatch:
|
|
release:
|
|
types: [published]
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
dmg:
|
|
name: ${{ matrix.rid }}
|
|
runs-on: macos-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
rid: [osx-arm64, osx-x64]
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up .NET
|
|
uses: actions/setup-dotnet@v4
|
|
with:
|
|
dotnet-version: "10.0.x"
|
|
|
|
- name: Resolve version
|
|
id: ver
|
|
run: |
|
|
if [ "${{ github.event_name }}" = "release" ]; then
|
|
version="${GITHUB_REF_NAME#v}"
|
|
else
|
|
version="$(sed -n 's/.*<Version>\(.*\)<\/Version>.*/\1/p' src/Directory.Build.props | head -1 | tr -d '[:space:]')"
|
|
fi
|
|
if [ -z "$version" ]; then
|
|
echo "Could not resolve version" >&2
|
|
exit 1
|
|
fi
|
|
echo "version=$version" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Publish
|
|
run: |
|
|
dotnet publish src/MaksIT.PostClient.UI/MaksIT.PostClient.UI.csproj \
|
|
-c Release \
|
|
-r ${{ matrix.rid }} \
|
|
--self-contained true \
|
|
-p:UseAppHost=true \
|
|
-p:PublishSingleFile=false \
|
|
-o "$RUNNER_TEMP/publish"
|
|
|
|
- name: Bundle .app and DMG
|
|
run: |
|
|
chmod +x packaging/macos/bundle.sh
|
|
packaging/macos/bundle.sh \
|
|
--publish-dir "$RUNNER_TEMP/publish" \
|
|
--version "${{ steps.ver.outputs.version }}" \
|
|
--rid "${{ matrix.rid }}" \
|
|
--icon src/MaksIT.PostClient.UI/Assets/icon.png \
|
|
--output-dir "$RUNNER_TEMP/dist"
|
|
|
|
- name: Upload workflow artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: postclient-${{ steps.ver.outputs.version }}-${{ matrix.rid }}
|
|
path: ${{ runner.temp }}/dist/postclient-${{ steps.ver.outputs.version }}-${{ matrix.rid }}.dmg
|
|
if-no-files-found: error
|
|
|
|
- name: Attach to GitHub Release
|
|
if: github.event_name == 'release'
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
gh release upload "${{ github.event.release.tag_name }}" \
|
|
"$RUNNER_TEMP/dist/postclient-${{ steps.ver.outputs.version }}-${{ matrix.rid }}.dmg" \
|
|
--clobber
|