release app #11
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: release app | |
on: | |
workflow_dispatch: | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
jobs: | |
release-ios: | |
runs-on: macos-14 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Xcode Select Version | |
uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: '15.1.0' | |
- name: Get Next Version | |
id: semver | |
uses: ietf-tools/semver-action@v1 | |
with: | |
skipInvalidTags: true | |
noVersionBumpBehavior: "error" | |
majorList: "major, breaking" | |
token: ${{ env.GITHUB_TOKEN }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Bump version in Config.xcconfig | |
run: | | |
CURRENT_BUILD=$(grep BUILD_NUMBER CoreDex/Config.xcconfig | cut -d ' ' -f 3) | |
NEW_BUILD=$((CURRENT_BUILD + 1)) | |
sed -i '' "s/BUILD_NUMBER = $CURRENT_BUILD/BUILD_NUMBER = $NEW_BUILD/" CoreDex/Config.xcconfig | |
CURRENT_VERSION=$(grep VERSION CoreDex/Config.xcconfig | cut -d ' ' -f 3) | |
NEW_VERSION=${{ steps.semver.outputs.nextStrict }} | |
sed -i '' "s/VERSION = $CURRENT_VERSION/VERSION = $NEW_VERSION/" CoreDex/Config.xcconfig | |
- name: Commit & Push changes | |
uses: EndBug/add-and-commit@v9 | |
with: | |
add: 'CoreDex/Config.xcconfig' | |
default_author: github_actions | |
fetch: false | |
message: 'Bump version [skip ci]' | |
push: true | |
- name: Build iOS app | |
run: xcodebuild -scheme CoreDex -sdk iphoneos -configuration Release -derivedDataPath build -destination generic/platform=iOS CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO | |
- name: Pack .ipa from .app | |
run: | | |
mkdir -p build/Build/Products/Release-iphoneos/Payload | |
mv build/Build/Products/Release-iphoneos/CoreDex.app build/Build/Products/Release-iphoneos/Payload/ | |
cd build/Build/Products/Release-iphoneos | |
zip -r ../../../CoreDex.ipa Payload | |
- name: Create GitHub Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ steps.semver.outputs.next }} | |
files: ./build/CoreDex.ipa | |
fail_on_unmatched_files: true | |
token: ${{ env.GITHUB_TOKEN }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |