Skip to content

System - Upgrade tools & clean #18

System - Upgrade tools & clean

System - Upgrade tools & clean #18

# Leka - iOS Monorepo
# Copyright 2023 APF France handicap
# SPDX-License-Identifier: Apache-2.0
name: System - Upgrade tools & clean
on:
pull_request:
types: [labeled]
schedule:
# Runs at 3:00 UTC every day
- cron: '0 3 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
upgrade_tools:
if: ${{ contains(github.event.label.name, 'ci:upgrade_tools') || contains(github.event_name, 'schedule') }} 
name: Upgrade tools
runs-on: [self-hosted, iOS]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1 # shallow clone
- name: Tools' versions before
run: |
which xcodebuild
xcodebuild -version
which fastlane
fastlane --version
which tuist
tuist version
which swiftlint
swiftlint --version
which swift-format
swift-format --version
which bundle
bundle --version
- name: Upgrade brew
run: |
brew update
brew upgrade
brew reinstall tuist --no-quarantine
brew cleanup -s --prune=all
- name: Upgrade bundle
run: |
bundle update --bundler
- name: tuist clean
run: |
tuist clean
- name: Delete Xcode derived data
run: |
rm -rf ~/Library/Developer/Xcode/DerivedData
- name: Tools' versions after
run: |
which xcodebuild
xcodebuild -version
which fastlane
fastlane --version
which tuist
tuist version
which swiftlint
swiftlint --version
which swift-format
swift-format --version
which bundle
bundle --version
- name: Remove label
if: contains(github.event.label.name, 'ci:upgrade_tools')
uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const { LABEL_NAME } = process.env
github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: LABEL_NAME
})
env:
LABEL_NAME: ${{ github.event.label.name }}