-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub Actions workflow for automated build and release process
- Loading branch information
Showing
1 changed file
with
89 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
name: Build and Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
permissions: | ||
contents: write | ||
discussions: write | ||
|
||
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: '16.1' | ||
|
||
- name: Install Tuist | ||
run: | | ||
brew install tuist | ||
- name: Generate Xcode Project | ||
run: | | ||
tuist generate --no-open | ||
- name: Build App | ||
run: | | ||
xcodebuild \ | ||
-workspace V2Bar.xcworkspace \ | ||
-scheme V2Bar \ | ||
-configuration Release \ | ||
-derivedDataPath ./DerivedData \ | ||
-arch arm64 -arch x86_64 \ | ||
clean build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | ||
- name: Create DMG | ||
run: | | ||
brew install create-dmg | ||
create-dmg \ | ||
--volname "V2Bar" \ | ||
--window-size 500 300 \ | ||
--icon-size 100 \ | ||
--icon "V2Bar.app" 150 150 \ | ||
--app-drop-link 350 150 \ | ||
--no-internet-enable \ | ||
"V2Bar-${{ github.ref_name }}.dmg" \ | ||
"DerivedData/Build/Products/Release/V2Bar.app" | ||
- name: Create Source Archives | ||
run: | | ||
zip -r "V2Bar-${{ github.ref_name }}-src.zip" . \ | ||
-x "*.git*" -x "build/*" -x "*.xcodeproj/*" -x "*.xcworkspace/*" -x "*.dmg" -x "DerivedData/*" | ||
- name: Generate Checksums | ||
run: | | ||
echo "### V2Bar ${{ github.ref_name }}" > checksums.txt | ||
echo "" >> checksums.txt | ||
echo "- Universal Binary (Apple Silicon + Intel)" >> checksums.txt | ||
echo "- macOS 13.0+" >> checksums.txt | ||
echo "" >> checksums.txt | ||
echo "### SHA-256 Checksums" >> checksums.txt | ||
echo "\`\`\`" >> checksums.txt | ||
shasum -a 256 "V2Bar-${{ github.ref_name }}.dmg" "V2Bar-${{ github.ref_name }}-src.zip" >> checksums.txt | ||
echo "\`\`\`" >> checksums.txt | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
with: | ||
files: | | ||
V2Bar-${{ github.ref_name }}.dmg | ||
V2Bar-${{ github.ref_name }}-src.zip | ||
checksums.txt | ||
body_path: checksums.txt | ||
draft: false | ||
prerelease: ${{ contains(github.ref, '-beta') || contains(github.ref, '-alpha') }} | ||
generate_release_notes: true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |