Update GitHub Actions workflow to use macOS 14 and Xcode 15.2; add Sw… #6
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: Build and Release | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
build: | |
name: Build and Release | |
runs-on: macos-14 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Xcode | |
uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: '15.2' | |
- name: Setup Swift | |
uses: swift-actions/setup-swift@v1 | |
with: | |
swift-version: '6.0.0' | |
- name: Setup mise | |
uses: jdx/mise-action@v2 | |
- name: Install Tuist | |
run: | | |
mise install tuist@latest | |
mise use -g tuist@latest | |
- name: Clean Tuist Cache | |
run: | | |
rm -rf ~/Library/Developer/Xcode/DerivedData || true | |
rm -rf ~/.tuist || true | |
rm -rf .tuist-bin || true | |
rm -rf Derived || true | |
rm -rf *.xcodeproj || true | |
rm -rf *.xcworkspace || true | |
- name: Setup Tuist | |
run: | | |
tuist install | |
tuist dependencies fetch | |
- name: Generate Xcode Project | |
run: | | |
tuist generate --no-open | |
- name: Build App | |
run: | | |
xcodebuild \ | |
-workspace TypeSwitch.xcworkspace \ | |
-scheme TypeSwitch \ | |
-configuration Release \ | |
-derivedDataPath ./DerivedData \ | |
-arch arm64 \ | |
clean build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | |
- name: Create DMG | |
run: | | |
brew install create-dmg | |
create-dmg \ | |
--volname "TypeSwitch" \ | |
--window-pos 200 120 \ | |
--window-size 800 400 \ | |
--icon-size 100 \ | |
--icon "DerivedData/Build/Products/Release/TypeSwitch.app" 200 190 \ | |
--hide-extension "TypeSwitch.app" \ | |
--app-drop-link 600 185 \ | |
"TypeSwitch.dmg" \ | |
"DerivedData/Build/Products/Release/TypeSwitch.app" | |
- name: Create Source Archives | |
run: | | |
zip -r "TypeSwitch-${{ github.ref_name }}-src.zip" . \ | |
-x "*.git*" -x "build/*" -x "*.xcodeproj/*" -x "*.xcworkspace/*" -x "*.dmg" -x "DerivedData/*" | |
- name: Generate Checksums | |
run: | | |
echo "### Checksums" > checksums.txt | |
echo "\`\`\`" >> checksums.txt | |
shasum -a 256 TypeSwitch.dmg "TypeSwitch-${{ github.ref_name }}-src.zip" >> checksums.txt | |
echo "\`\`\`" >> checksums.txt | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
TypeSwitch.dmg | |
TypeSwitch-${{ github.ref_name }}-src.zip | |
checksums.txt | |
body_path: checksums.txt | |
draft: false | |
prerelease: ${{ contains(github.ref, '-beta') || contains(github.ref, '-alpha') }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |