Add macOS workflow #6
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
on: | |
push: | |
branches: [main] | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
name: macOS | |
jobs: | |
macos: | |
name: macOS | |
runs-on: macos-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Install Dependencies | |
run: brew bundle | |
- name: Setup | |
run: brew bundle exec -- meson setup build -Ddistro=true --prefix=${{ github.workspace }}/tuba-macos | |
- name: Configure | |
run: brew bundle exec -- meson configure build -Ddevel=true | |
- name: Compile | |
run: brew bundle exec -- meson compile -C build --verbose | |
- name: Test | |
run: brew bundle exec -- ninja test -C build | |
- name: Install | |
run: brew bundle exec -- meson install -C build | |
- name: Post Install | |
run: | | |
brew bundle exec -- glib-compile-schemas tuba-macos/share/glib-2.0/schemas | |
brew bundle exec -- gtk4-update-icon-cache -f -t tuba-macos/share/icons/hicolor | |
- name: Create App Bundle | |
run: | | |
mkdir -p tuba-macos/Tuba.app/Contents/MacOS | |
mv tuba-macos/bin/dev.geopjr.Tuba tuba-macos/Tuba.app/Contents/MacOS/ | |
mkdir -p tuba-macos/Tuba.app/Contents/Resources | |
mv tuba-macos/share/ tuba-macos/Tuba.app/Contents/Resources/ | |
cat <<EOF >tuba-macos/Tuba.app/Contents/Info.plist | |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>CFBundleDisplayName</key> | |
<string>Tuba</string> | |
<key>CFBundleExecutable</key> | |
<string>dev.geopjr.Tuba</string> | |
<key>CFBundleIconFile</key> | |
<string>dev.geopjr.Tuba.svg</string> | |
<key>CFBundleIconName</key> | |
<string>dev.geopjr.Tuba.svg</string> | |
<key>CFBundleIdentifier</key> | |
<string>dev.geopjr.Tuba</string> | |
<key>CFBundleInfoDictionaryVersion</key> | |
<string>6.0</string> | |
<key>CFBundleName</key> | |
<string>Tuba</string> | |
<key>CFBundlePackageType</key> | |
<string>APPL</string> | |
<key>CFBundleShortVersionString</key> | |
<string>$(meson introspect --projectinfo build | jq -r '.version')</string> | |
<key>CFBundleSupportedPlatforms</key> | |
<array> | |
<string>MacOSX</string> | |
</array> | |
<key>CFBundleVersion</key> | |
<string>$(meson introspect --projectinfo build | jq -r '.version')</string> | |
<key>LSApplicationCategoryType</key> | |
<string>public.app-category.social-networking</string> | |
<key>MDItemKeywords</key> | |
<string>toot, mastodon, fediverse, gotosocial, pleroma, akkoma</string> | |
</dict> | |
</plist> | |
EOF | |
# Run with XDG_DATA_DIRS=Tuba.app/Contents/Resources/share for now | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: taba-macos | |
path: tuba-macos | |
if-no-files-found: error |