Skip to content

Commit

Permalink
Merge pull request #714 from rgoldberg/713-cleanup
Browse files Browse the repository at this point in the history
Improve scripts, GitHub workflows & docs
  • Loading branch information
rgoldberg authored Jan 15, 2025
2 parents 0fa1252 + a148c9d commit 69e06d9
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 19 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
# Force all run commands to not use Rosetta 2
shell: arch -arm64 /bin/zsh -Negku {0}
steps:
- name: Checkout
- name: 🛒 Checkout repo
env:
GIT_CONFIG_COUNT: 1
GIT_CONFIG_KEY_0: init.defaultBranch
Expand All @@ -31,17 +31,20 @@ jobs:
# Include all history & tags for script/version
fetch-depth: 0

- name: Setup repo
- name: 🔧 Setup repo
run: script/setup_workflow_repo

- name: Bootstrap
- name: 🛠 Select Xcode 16.2
run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer

- name: 👢 Bootstrap
run: script/bootstrap

- name: Build
- name: 🏗 Build
run: script/build build-test

- name: Test
- name: 🧪 Test
run: script/test

- name: Lint
- name: 🚨 Lint
run: script/lint
10 changes: 5 additions & 5 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- language: swift
build-mode: manual
steps:
- name: Checkout repository
- name: 🛒 Checkout repo
env:
GIT_CONFIG_COUNT: 1
GIT_CONFIG_KEY_0: init.defaultBranch
Expand All @@ -37,23 +37,23 @@ jobs:
# Include all history & tags for script/version
fetch-depth: 0

- name: Setup repo
- name: 🔧 Setup repo
run: script/setup_workflow_repo

- name: Initialize CodeQL
- name: 🔩 Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{matrix.language}}
build-mode: ${{matrix.build-mode}}
queries: ${{matrix.language == 'swift' && '+security-and-quality' || ''}}

- name: Build Swift
- name: 🏗 Build Swift
if: matrix.language == 'swift'
shell: bash
run: |
script/build codeql
- name: Perform CodeQL Analysis
- name: 🔍 Perform CodeQL analysis
uses: github/codeql-action/analyze@v3
with:
category: /language:${{matrix.language}}
7 changes: 4 additions & 3 deletions .github/workflows/tag-pushed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,11 @@ jobs:
exit 3
fi
- name: 🛠 Select Xcode 16.2
run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer

- name: 📦 Build universal executable & package it in an installer
run: |
sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
script/package package
run: script/package package

- name: 🚰 Bump custom tap formula
env:
Expand Down
1 change: 1 addition & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ disabled_rules:
# eventually enable
- file_header
- one_declaration_per_file
- prefer_key_path
- trailing_comma
# never enable
- contrasted_opening_brace
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ If mas doesn't work for you as expected (e.g. you can't install/upgrade apps), r
If the issue persists, please [file a bug](/~https://github.com/mas-cli/mas/issues/new).
All feedback is much appreciated! ✨

## ℹ️ Build from source
## 🏗 Build from source

You can build from Xcode by opening the root mas directory, or from the Terminal:

Expand All @@ -318,7 +318,7 @@ script/build

Build output can be found in the `.build` directory within the project.

## Tests
## 🧪 Tests

Tests are written using [Quick](/~https://github.com/Quick/Quick) & [Nimble](/~https://github.com/Quick/Nimble).

Expand Down
4 changes: 3 additions & 1 deletion script/clean
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
# script/clean
# mas
#
# Deletes the build directory.
# Deletes the build directory & other generated files.
#

. "${0:a:h}/_setup_script"

printf $'==> 🗑 Cleaning mas %s\n' "$(script/version)"

swift package clean
swift package reset
rm -f Sources/mas/Package.swift
2 changes: 1 addition & 1 deletion script/format
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

. "${0:a:h}/_setup_script"

printf $'==> 🚨 Formatting mas %s\n' "$(script/version)"
printf $'==> 🧹 Formatting mas %s\n' "$(script/version)"

for formatter in markdownlint prettier swift-format swiftformat swiftlint yamllint; do
if ! command -v "${formatter}" >/dev/null; then
Expand Down
2 changes: 1 addition & 1 deletion script/test
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

. "${0:a:h}/_setup_script"

printf $'==> Testing mas %s\n' "$(script/version)"
printf $'==> 🧪 Testing mas %s\n' "$(script/version)"

script/generate_package_swift test

Expand Down

0 comments on commit 69e06d9

Please sign in to comment.