Skip to content

Commit

Permalink
🔀️ Merge branch 'release/LekaApp/1.14.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
ladislas committed Nov 12, 2024
2 parents 90b8330 + 233342e commit 8a6f072
Show file tree
Hide file tree
Showing 70 changed files with 2,083 additions and 298 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/ci-fastlane-release_app_store.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,17 @@ jobs:
run: |
echo "$HOME/.local/share/mise/shims" >> $GITHUB_PATH
- uses: actions/cache@v4
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ runner.name }}-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-${{ runner.name }}-
${{ runner.os }}-gems-
- name: bundle install
run: |
bundle config path vendor/bundle
bundle install
- name: tuist install
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/ci-fastlane-release_beta_internal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,17 @@ jobs:
run: |
echo "$HOME/.local/share/mise/shims" >> $GITHUB_PATH
- uses: actions/cache@v4
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ runner.name }}-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-${{ runner.name }}-
${{ runner.os }}-gems-
- name: bundle install
run: |
bundle config path vendor/bundle
bundle install
- name: tuist install
Expand Down Expand Up @@ -111,7 +120,7 @@ jobs:

- name: remove label
if: always() && github.event_name == 'pull_request' && contains(github.event.label.name, 'fastlane:beta')
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
Expand Down
100 changes: 100 additions & 0 deletions .github/workflows/ci-tools-cancel_workflows_on_pr_closed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# Leka - iOS Monorepo
# Copyright APF France handicap
# SPDX-License-Identifier: Apache-2.0

name: Cancel Workflows on PR Close or Label

on:
pull_request:
types: [closed, labeled]

jobs:
cancel-workflows:
runs-on: ubuntu-latest
permissions:
actions: write
pull-requests: read
steps:
- name: Cancel Running Workflows Based on Event
uses: actions/github-script@v7
with:
script: |
const { owner, repo } = context.repo;
const eventName = context.eventName;
const action = context.payload.action;
const currentRunId = context.runId;
let prNumber;
let prHeadSha;
if (eventName === 'pull_request' && action === 'closed') {
// Event triggered by PR closure
prNumber = context.payload.pull_request.number;
prHeadSha = context.payload.pull_request.head.sha;
console.log(`Triggered by pull_request 'closed' event for PR #${prNumber}`);
} else if (eventName === 'pull_request' && action === 'labeled') {
// Event triggered by label addition
prNumber = context.payload.pull_request.number;
const labelName = context.payload.label.name;
console.log(`Triggered by pull_request 'labeled' event for PR #${prNumber}`);
console.log(`Label added: "${labelName}"`);
// Check if the label matches the one we're interested in
if (labelName !== '🛑️ cancel workflows') {
console.log('Label does not match. Exiting.');
return;
}
prHeadSha = context.payload.pull_request.head.sha;
} else {
console.log('Unsupported event type or action. Exiting.');
return;
}
console.log(`PR Number: ${prNumber}`);
console.log(`PR Head SHA: ${prHeadSha}`);
console.log(`Current Run ID: ${currentRunId}`);
// Fetch all in-progress and queued workflow runs
const statuses = ['in_progress', 'queued', 'requested', 'waiting', 'pending'];
let runs = [];
for (const status of statuses) {
const response = await github.rest.actions.listWorkflowRunsForRepo({
owner: owner,
repo: repo,
status: status,
per_page: 100,
head_sha: prHeadSha,
});
runs = runs.concat(response.data.workflow_runs);
}
console.log(`Total in-progress or queued runs: ${runs.length}`);
runs.forEach(run => {
const runInfo = [
` - ID: ${run.id}`,
` Name: ${run.name}`,
` Head SHA: ${run.head_sha}`,
` Event: ${run.event}`,
` Status: ${run.status}`
];
console.log(runInfo.join('\n'));
});
// Cancel runs associated with the PR's head SHA, excluding the current run
for (const run of runs) {
if (run.id !== currentRunId && run.head_sha === prHeadSha) {
try {
await github.rest.actions.cancelWorkflowRun({
owner,
repo,
run_id: run.id,
});
console.log(`Cancelled workflow run: ${run.id}`);
} catch (error) {
console.error(`Failed to cancel workflow run: ${run.id}. Error: ${error.message}`);
}
}
}
40 changes: 29 additions & 11 deletions Apps/LekaApp/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,50 @@
import ProjectDescription
import ProjectDescriptionHelpers

let kLekaAppVersion: String = {
guard Environment.productionBuild.getBoolean(default: false) else {
return "999.999.999"
}

// ? App version
return "1.13.0"
}()
let kLekaApp: App = if Environment.productionBuild.getBoolean(
default: false
) {
.init(
version: "1.14.0",
bundleId: "io.leka.apf.app.LekaApp",
name: "Leka",
urlSchemes: "LekaApp",
appIcon: "AppIcon"
)
} else {
.init(
version: "99.00.00",
bundleId: "io.leka.apf.app.LekaApp.beta",
name: "Leka Beta",
urlSchemes: "LekaAppBeta",
appIcon: "AppIconBeta"
)
}

let project = Project.app(
name: "LekaApp",
version: kLekaAppVersion,
version: kLekaApp.version,
bundleId: kLekaApp.bundleId,
infoPlist: [
"LSApplicationCategoryType": "public.app-category.education",
"CFBundleName": "\(kLekaApp.name)",
"CFBundleURLTypes": [
[
"CFBundleTypeRole": "Editor",
"CFBundleURLName": "io.leka.apf.app.LekaApp",
"CFBundleURLSchemes": ["LekaApp"],
"CFBundleURLName": "\(kLekaApp.bundleId)",
"CFBundleURLSchemes": ["\(kLekaApp.urlSchemes)"],
],
],
"LSApplicationQueriesSchemes": ["LekaUpdater"],
"UIBackgroundModes": [
"bluetooth-central",
"audio",
],
"FirebaseAutomaticScreenReportingEnabled": "NO",
],
settings: SettingsDictionary.extendingBase(with: [
"ASSETCATALOG_COMPILER_APPICON_NAME": "\(kLekaApp.appIcon)",
]),
dependencies: [
.project(target: "AccountKit", path: Path("../../Modules/AccountKit")),
.project(target: "ContentKit", path: Path("../../Modules/ContentKit")),
Expand All @@ -44,6 +61,7 @@ let project = Project.app(
.project(target: "RobotKit", path: Path("../../Modules/RobotKit")),
.project(target: "UtilsKit", path: Path("../../Modules/UtilsKit")),

.external(name: "AppUpdately"),
.external(name: "DeviceKit"),
.external(name: "Fit"),
.external(name: "MarkdownUI"),
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"images" : [
{
"filename" : "AppIconBeta.jpg",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "tinted"
}
],
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading

0 comments on commit 8a6f072

Please sign in to comment.