Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 0 additions & 74 deletions .github/workflows/build-loop.yml

This file was deleted.

159 changes: 159 additions & 0 deletions .github/workflows/dev-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
name: Loop Development Build

on:
workflow_dispatch:
workflow_call:

jobs:
pre-release:
name: Build and Publish Pre-release
runs-on: macos-14
permissions:
contents: write
pull-requests: read
steps:
- name: ⬇️ Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: 🧪 Set Version and Build number
run: |
# CHANGE EVERY RELEASE:
APP_VERSION="🧪 1.1.0"
APP_BUILD=$(git rev-list --count HEAD)

# Set VERSION
latest_tag=$APP_VERSION
echo "Latest tag: $latest_tag"
sed -i -e "/VERSION =/ s/= .*/= $latest_tag/" Loop/Config.xcconfig

# Set BUILD_NUMBER
latest_commit_number=$APP_BUILD
echo "Latest commit number: $latest_commit_number"
sed -i -e "/BUILD_NUMBER =/ s/= .*/= $latest_commit_number/" Loop/Config.xcconfig

echo "APP_VERSION=$APP_VERSION" >> $GITHUB_ENV
echo "APP_BUILD=$APP_BUILD" >> $GITHUB_ENV

- name: 🔧 Select Xcode
run: sudo xcode-select -s "/Applications/Xcode_15.4.app"

- name: 🎟️ Install Certificate
env:
DEVELOPMENT_CERT_BASE64: ${{ secrets.DEVELOPMENT_CERT_BASE64 }}
DEVELOPER_ID_CERT_BASE64: ${{ secrets.DEVELOPER_ID_CERT_BASE64 }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
DEVELOPMENT_CERT_PATH=$RUNNER_TEMP/dev.p12
DEVELOPER_ID_CERT_PATH=$RUNNER_TEMP/devid.p12
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db

echo -n "$DEVELOPMENT_CERT_BASE64" | base64 --decode -o $DEVELOPMENT_CERT_PATH
echo -n "$DEVELOPER_ID_CERT_BASE64" | base64 --decode -o $DEVELOPER_ID_CERT_PATH

security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH

security import $DEVELOPMENT_CERT_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security import $DEVELOPER_ID_CERT_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH

security list-keychain -d user -s $KEYCHAIN_PATH

- name: 🛠️ Build Loop
run: |
xcodebuild \
archive \
-project Loop.xcodeproj/ \
-scheme "Loop (GH ACTIONS)" \
-destination 'generic/platform=macOS' \
-archivePath dist/Loop.xcarchive

- name: 🥡 Export Loop.app
run: |
xcodebuild \
-exportArchive \
-archivePath dist/Loop.xcarchive \
-exportPath dist/ \
-exportOptionsPlist assets/ExportOptions.plist \
-allowProvisioningUpdates

- name: 🤏 Compress Loop
run: |
ditto -c -k --sequesterRsrc --keepParent "dist/Loop.app" "dist/Loop.zip"

- name: ✅ Notarize Loop
env:
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PWD: ${{ secrets.APPLE_ID_PWD }}
run: |
xcrun notarytool store-credentials Loop --apple-id "$APPLE_ID" --team-id "$APPLE_TEAM_ID" --password "$APPLE_ID_PWD"
xcrun notarytool submit "dist/Loop.zip" --keychain-profile "Loop" --wait
xcrun stapler staple "dist/Loop.app"

- name: ⬆️ Upload Loop
uses: actions/upload-artifact@v4
with:
name: Loop.zip
path: dist/Loop.app

- name: 🏷️ Create/update tag
uses: actions/github-script@v7
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/prerelease',
sha: context.sha
}).catch(err => {
if (err.status !== 422) throw err;
github.rest.git.updateRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'tags/prerelease',
sha: context.sha
});
})

- name: 📰 Build Changelog
uses: mikepenz/release-changelog-builder-action@v4
with:
outputFile: CHANGELOG.md
configurationJson: |
{
"template": "#{{CHANGELOG}}\n## 💭 Uncategorized\n#{{UNCATEGORIZED}}",
"pr_template": "- ##{{NUMBER}} #{{TITLE}}\n",
"categories": [
{
"title": "## ✨ New Features",
"labels": ["Feature", "Localization", "Luminare"]
},
{
"title": "## 🐞 Bug Fixes",
"labels": ["Bug"]
}
],
"empty_template": "- ❌ No changes found"
}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: 🥳 Publish Dev Build
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: dist/Loop.zip
commit: main
bodyFile: CHANGELOG.md
name: ${{ env.APP_VERSION }} (${{ env.APP_BUILD }})
prerelease: true
draft: true
tag: "prerelease"

- name: 🧹 Cleanup
run: |
security delete-keychain "$RUNNER_TEMP/app-signing.keychain-db"
Original file line number Diff line number Diff line change
@@ -1,48 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1530"
version = "1.7">
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<PreActions>
<ExecutionAction
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
<ActionContent
title = "Run Script"
scriptText = "$SRCROOT/assets/set_build_number.sh&#10;"
shellToInvoke = "/bin/bash">
<EnvironmentBuildable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A8E59C34297F5E9A0064D4BA"
BuildableName = "Loop.app"
BlueprintName = "Loop"
ReferencedContainer = "container:Loop.xcodeproj">
</BuildableReference>
</EnvironmentBuildable>
</ActionContent>
</ExecutionAction>
</PreActions>
<PostActions>
<ExecutionAction
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
<ActionContent
title = "Run Script"
scriptText = "$SRCROOT/assets/reset_build_number.sh&#10;"
shellToInvoke = "/bin/bash">
<EnvironmentBuildable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "A8E59C34297F5E9A0064D4BA"
BuildableName = "Loop.app"
BlueprintName = "Loop"
ReferencedContainer = "container:Loop.xcodeproj">
</BuildableReference>
</EnvironmentBuildable>
</ActionContent>
</ExecutionAction>
</PostActions>
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
Expand Down
18 changes: 18 additions & 0 deletions assets/ExportOptions.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>compileBitcode</key>
<false/>
<key>method</key>
<string>developer-id</string>
<key>signingStyle</key>
<string>automatic</string>
<key>stripSwiftSymbols</key>
<true/>
<key>teamID</key>
<string>5F967GYF84</string>
<key>thinning</key>
<string>&lt;none&gt;</string>
</dict>
</plist>