Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use with Github Actions? #75

Closed
LuegM opened this issue May 23, 2024 · 3 comments
Closed

How to use with Github Actions? #75

LuegM opened this issue May 23, 2024 · 3 comments

Comments

@LuegM
Copy link

LuegM commented May 23, 2024

I am using Github Actions to build my app and distribute it to Testflight.

- name: Checkout repository
        uses: actions/checkout@v4
        with:
          fetch-depth: 0

- name: build archive
        run: |
          xcodebuild -scheme "AppName" \
          -archivePath $RUNNER_TEMP/AppName.xcarchive \
          -sdk iphoneos \
          -configuration Release \
          -destination generic/platform=iOS \
          clean archive          

- name: export ipa
  env:
    EXPORT_OPTIONS_PLIST: ${{ secrets.EXPORT_OPTIONS_PLIST }}
  run: |
    EXPORT_OPTS_PATH=$RUNNER_TEMP/ExportOptions.plist
    echo -n "$EXPORT_OPTIONS_PLIST" | base64 --decode -o $EXPORT_OPTS_PATH
    xcodebuild -exportArchive -archivePath $RUNNER_TEMP/AppName.xcarchive -exportOptionsPlist $EXPORT_OPTS_PATH -exportPath $RUNNER_TEMP/build

Would this plugin work with my automation?
Or what would I need to do to make it work?

@LuegM
Copy link
Author

LuegM commented May 23, 2024

I would run the following:

git clone https://github.com/liamnichols/xcstrings-tool
cd xcstrings-tool
swift build -c release
.build/release/xcstrings-tool generate path/to/localizable.xcstrings path/to/generated.swift

But is this enough?
And will my action compile with the package + added Build Phase?
Or do I need to add the Build Phase somehow to the xcode which runs inside the Github Action?

@liamnichols
Copy link
Owner

Hey @LuegM, you shouldn't need to run the xcstrings-tool cli directly if you add the Build Tool plugin to your project as per these instructions: https://swiftpackageindex.com/liamnichols/xcstrings-tool/0.3.0/documentation/documentation/integrating-xcstrings-tool-into-an-xcode-project-target

The only thing that you would need to do on the CI is to mark the plugin as trusted by doing something like this: #42 (reply in thread)

@LuegM
Copy link
Author

LuegM commented May 27, 2024

Thank you!

adding this was enough for it to work:

- name: Set Xcode Defaults
  run: defaults write com.apple.dt.Xcode IDESkipPackagePluginFingerprintValidatation -bool YES

@LuegM LuegM closed this as completed May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants