Skip to content

Commit

Permalink
Add GitHub workflows (#1075)
Browse files Browse the repository at this point in the history
  • Loading branch information
waliid authored Dec 3, 2024
1 parent d4c1701 commit 1902b28
Show file tree
Hide file tree
Showing 17 changed files with 260 additions and 160 deletions.
1 change: 0 additions & 1 deletion .env

This file was deleted.

39 changes: 39 additions & 0 deletions .github/workflows/nightlies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: Nightlies

on: # yamllint disable-line rule:truthy
push:
branches: main

jobs:
deliver-demo-nightlies:
name: 🌙 Nightlies
runs-on: macos-latest
strategy:
matrix:
platform: [ios, tvos]
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Add Apple certificate
run: |
Scripts/add-apple-certificate.sh \
$RUNNER_TEMP \
${{ secrets.KEYCHAIN_PASSWORD }} \
${{ secrets.APPLE_DEV_CERTIFICATE }} \
${{ secrets.APPLE_DEV_CERTIFICATE_PASSWORD }}
- name: Configure environment
run: |
Scripts/configure-environment.sh \
${{ secrets.APP_STORE_CONNECT_API_KEY }}
- name: Archive the demo
run: |
make deliver-demo-nightly-${{ matrix.platform }}
env:
TEAM_ID: ${{ secrets.TEAM_ID }}
KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
KEY_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ISSUER_ID }}
TESTFLIGHT_GROUPS: ${{ vars.TESTFLIGHT_GROUPS }}
71 changes: 71 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
name: Pull Request

on: # yamllint disable-line rule:truthy

Check warning on line 4 in .github/workflows/pull-request.yml

View workflow job for this annotation

GitHub Actions / 🔎 Check quality

4:5 [comments] too few spaces before comment
merge_group:
pull_request:

jobs:
check-quality:
name: 🔎 Check quality
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run the quality check
run: make check-quality

build-documentation:
name: 📚 Build documentation
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Build the documentation
run: make doc

tests:
name: 🧪 Tests
runs-on: macos-latest
strategy:
matrix:
platform: [ios, tvos]
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run tests
run: make test-${{ matrix.platform }}

archive-demos:
name: 📦 Archives
runs-on: macos-latest
strategy:
matrix:
platform: [ios, tvos]
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Add Apple certificate
run: |
Scripts/add-apple-certificate.sh \
$RUNNER_TEMP \
${{ secrets.KEYCHAIN_PASSWORD }} \
${{ secrets.APPLE_DEV_CERTIFICATE }} \
${{ secrets.APPLE_DEV_CERTIFICATE_PASSWORD }}
- name: Configure environment
run: |
Scripts/configure-environment.sh \
${{ secrets.APP_STORE_CONNECT_API_KEY }}
- name: Archive the demo
run: make archive-demo-${{ matrix.platform }}
env:
TEAM_ID: ${{ secrets.TEAM_ID }}
KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
KEY_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ISSUER_ID }}
TESTFLIGHT_GROUPS: ${{ vars.TESTFLIGHT_GROUPS }}
40 changes: 40 additions & 0 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: Releases

on: # yamllint disable-line rule:truthy
push:
branches: main
tags: '*'

jobs:
deliver-demo-releases:
name: 🚀 Releases
runs-on: macos-latest
strategy:
matrix:
platform: [ios, tvos]
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Add Apple certificate
run: |
Scripts/add-apple-certificate.sh \
$RUNNER_TEMP \
${{ secrets.KEYCHAIN_PASSWORD }} \
${{ secrets.APPLE_DEV_CERTIFICATE }} \
${{ secrets.APPLE_DEV_CERTIFICATE_PASSWORD }}
- name: Configure environment
run: |
Scripts/configure-environment.sh \
${{ secrets.APP_STORE_CONNECT_API_KEY }}
- name: Archive the demo
run: |
make deliver-demo-release-${{ matrix.platform }}
env:
TEAM_ID: ${{ secrets.TEAM_ID }}
KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
KEY_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ISSUER_ID }}
TESTFLIGHT_GROUPS: ${{ vars.TESTFLIGHT_GROUPS }}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ DerivedData/
/fastlane/README.md
/fastlane/report.xml
/fastlane/test_output
/Configuration

/.bundle
/vendor
16 changes: 8 additions & 8 deletions Artifacts/PackageInfo.artifactbundle/package-info.sh
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
#!/bin/bash

GENERATED_FILE_PATH="$2/PackageInfo.swift"

if [ "$#" -ne 2 ]; then
echo "usage: $(basename "$0") repository_directory output_directory"
exit 1
fi

if ! VERSION=$(git --git-dir "$1/.git" describe --tags 2> /dev/null); then
VERSION="0.0.0"
if ! version=$(git --git-dir "$1/.git" describe --tags 2> /dev/null); then
version="0.0.0"
fi

if ! SHORT_VERSION=$(git --git-dir "$1/.git" describe --tags --abbrev=0 2> /dev/null); then
SHORT_VERSION="0.0.0"
if ! short_version=$(git --git-dir "$1/.git" describe --tags --abbrev=0 2> /dev/null); then
short_version="0.0.0"
fi

GENERATED_FILE_PATH="$2/PackageInfo.swift"

cat > "$GENERATED_FILE_PATH" <<- EOF
// This file is generated automatically. Do not modify.
import Foundation
enum PackageInfo {
static let version = "$VERSION"
static let shortVersion = "$SHORT_VERSION"
static let version = "$version"
static let shortVersion = "$short_version"
}
EOF
2 changes: 0 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
source 'https://rubygems.org'

gem 'fastlane'
gem 'rubocop'
gem 'xcode-install'

plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
44 changes: 9 additions & 35 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,18 @@ GEM
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
artifactory (3.0.17)
ast (2.4.2)
atomos (0.1.3)
aws-eventstream (1.3.0)
aws-partitions (1.998.0)
aws-sdk-core (3.211.0)
aws-partitions (1.1014.0)
aws-sdk-core (3.214.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.992.0)
aws-sigv4 (~> 1.9)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.95.0)
aws-sdk-kms (1.96.0)
aws-sdk-core (~> 3, >= 3.210.0)
aws-sigv4 (~> 1.5)
aws-sdk-s3 (1.169.0)
aws-sdk-s3 (1.174.0)
aws-sdk-core (~> 3, >= 3.210.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.5)
Expand Down Expand Up @@ -162,49 +161,28 @@ GEM
domain_name (~> 0.5)
httpclient (2.8.3)
jmespath (1.6.2)
json (2.7.5)
json (2.8.2)
jwt (2.9.3)
base64
language_server-protocol (3.17.0.3)
mini_magick (4.13.2)
mini_mime (1.1.5)
multi_json (1.15.0)
multipart-post (2.4.1)
nanaimo (0.4.0)
naturally (2.2.1)
nkf (0.2.0)
optparse (0.5.0)
optparse (0.6.0)
os (1.1.4)
parallel (1.26.3)
parser (3.3.5.0)
ast (~> 2.4.1)
racc
plist (3.7.1)
public_suffix (6.0.1)
racc (1.8.1)
rainbow (3.1.1)
rake (13.2.1)
regexp_parser (2.9.2)
representable (3.2.0)
declarative (< 0.1.0)
trailblazer-option (>= 0.1.1, < 0.2.0)
uber (< 0.2.0)
retriable (3.1.2)
rexml (3.3.9)
rouge (2.0.7)
rubocop (1.67.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.4, < 3.0)
rubocop-ast (>= 1.32.2, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.33.0)
parser (>= 3.3.1.0)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
security (0.1.5)
Expand All @@ -228,10 +206,7 @@ GEM
uber (0.1.0)
unicode-display_width (2.6.0)
word_wrap (1.0.0)
xcode-install (2.8.1)
claide (>= 0.9.1)
fastlane (>= 2.1.0, < 3.0.0)
xcodeproj (1.26.0)
xcodeproj (1.27.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
Expand All @@ -248,15 +223,14 @@ PLATFORMS
arm64-darwin-22
arm64-darwin-23
arm64-darwin-24
ruby
x86_64-darwin-21
x86_64-darwin-22

DEPENDENCIES
fastlane
fastlane-plugin-badge
fastlane-plugin-xcconfig
rubocop
xcode-install

BUNDLED WITH
2.3.7
2.5.23
Loading

0 comments on commit 1902b28

Please sign in to comment.