Skip to content

Commit

Permalink
Merge pull request #41 from galadril/test/osx-versioning
Browse files Browse the repository at this point in the history
Test/osx versioning
  • Loading branch information
galadril authored May 2, 2024
2 parents 8b73154 + ff6ce9c commit 60b34c1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 35 deletions.
54 changes: 21 additions & 33 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Build
name: Build

on:
push:
branches: [ main ]
workflow_dispatch:

env:
VERSION: 1.0.16
VERSION: 1.0.17

concurrency:
group: ${{ github.ref }}
Expand All @@ -16,17 +16,9 @@ jobs:
build-windows:
runs-on: windows-latest

permissions:
contents: write

steps:
- uses: actions/checkout@v4

- name: Setup Git user
run: |
git config --local user.name "GitHub Actions"
git config --local user.email "<>"
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
Expand Down Expand Up @@ -85,25 +77,14 @@ jobs:
run:
working-directory: ${{ github.workspace }}/OSX

permissions:
contents: write

steps:
- name: Checkout files
uses: actions/checkout@v4

- name: Setup Git user
run: |
git config --local user.name "GitHub Actions"
git config --local user.email "<>"
- uses: actions/setup-node@v4
with:
node-version: 21

- name: List Xcode installations
run: sudo ls -1 /Applications | grep "Xcode"

- name: Select XCode version
uses: maxim-lobanov/[email protected]
with:
Expand All @@ -125,11 +106,24 @@ jobs:
- name: Install dependencies
run: bundle install

- name: Bump ios version
uses: yanamura/ios-bump-version@v1
with:
version: ${{ env.VERSION }}
project-path: OSX
- name: Update Info.plist and project.pbxproj files
run: |
VERSION=${{ env.VERSION }}
VERSION_NO_DOTS=$(echo $VERSION | tr -d '.')
echo "Version without dots: $VERSION_NO_DOTS"
echo "Version with dots: $VERSION"
find . -name 'Info.plist' | while read file; do
echo "Processing file: $file"
sed -i '' -e "s/<key>CFBundleVersion<\/key>[[:space:]]*<string>[[:digit:]]*<\/string>/<key>CFBundleVersion<\/key>\
<string>$VERSION_NO_DOTS<\/string>/g" "$file"
sed -i '' -e "s/<key>CFBundleShortVersionString<\/key>[[:space:]]*<string>[[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*<\/string>/<key>CFBundleShortVersionString<\/key>\
<string>$VERSION<\/string>/g" "$file"
done
echo "Updating project.pbxproj"
sed -i '' -e "s/CURRENT_PROJECT_VERSION = [[:digit:]]*/CURRENT_PROJECT_VERSION = $VERSION_NO_DOTS/g" ./CaptureWolf.xcodeproj/project.pbxproj
sed -i '' -e "s/MARKETING_VERSION = .*;/MARKETING_VERSION = $VERSION;/g" ./CaptureWolf.xcodeproj/project.pbxproj
shell: bash

- name: Deploy app
run: bundle exec fastlane mac release --verbose
Expand All @@ -144,15 +138,9 @@ jobs:
with:
name: osx-installer
path: ./OSX/release/

- name: "Show changes"
run: |
git status
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5

create-release:
if: github.ref == 'refs/heads/main'
needs: [build-windows, build-osx]
runs-on: ubuntu-latest
steps:
Expand Down
4 changes: 2 additions & 2 deletions OSX/CaptureWolf.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Developer ID Application";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 37;
CURRENT_PROJECT_VERSION = 1016;
DEVELOPMENT_ASSET_PATHS = "\"CaptureWolf/Preview Content\"";
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=macosx*]" = FN7VC8ZTQF;
Expand Down Expand Up @@ -383,7 +383,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Developer ID Application";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 37;
CURRENT_PROJECT_VERSION = 1016;
DEVELOPMENT_ASSET_PATHS = "\"CaptureWolf/Preview Content\"";
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=macosx*]" = FN7VC8ZTQF;
Expand Down

0 comments on commit 60b34c1

Please sign in to comment.