Skip to content

Commit

Permalink
Merge pull request #777 from willowtreeapps/task/732-migrate-to-githu…
Browse files Browse the repository at this point in the history
…bactions

[732] - Migrate to GitHub Actions
  • Loading branch information
Clstroud authored Aug 10, 2024
2 parents 625520e + 35cded1 commit 0d373a4
Show file tree
Hide file tree
Showing 69 changed files with 363 additions and 233,939 deletions.
136 changes: 0 additions & 136 deletions .circleci/config.yml

This file was deleted.

19 changes: 19 additions & 0 deletions .github/workflows/actions/run_lane/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Run Lane
description: Run a fastane lane and upload artifacts
inputs:
lane:
description: Name of fastlane lane to run
required: true
match_password:
description: Match password, ideally in secrets.MATCH_PASSWORD
required: false
runs:
using: composite
steps:
- name: Run fastlane
run: bundle exec fastlane ${{ inputs.lane }}
shell: sh
env:
MATCH_PASSWORD: ${{ inputs.match_password }}

# TODO: Artifacts
65 changes: 65 additions & 0 deletions .github/workflows/crowdin_pull.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Pull Translations From Crowdin
on:
workflow_dispatch:
schedule:
- cron: "0 */3 * * *" # Run every 3 hours

jobs:
synchronize-with-crowdin:
runs-on: macos-14
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Crowdin CLI
run: brew install crowdin
shell: sh

- name: Download Translations
run: crowdin bundle download 6
shell: sh
env:
GITHUB_TOKEN: ${{ secrets.CROWDIN_GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}

- name: Set up Ruby environment
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0

- name: Install bundler
run: gem install bundler

- name: Install dependencies
run: bundle install

- name: Install SwiftLint
run: brew install swiftlint

- name: Import XLIFFs to project
uses: ./.github/workflows/actions/run_lane
with:
lane: xliff_import

- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.CROWDIN_PR_BOT_TOKEN }}
commit-message: Update Localizations
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>
signoff: false
branch: crowdin/update-translations-bot
base: develop
delete-branch: true
add-paths: |
Vocable/**/*.xcstrings
Vocable/**/*.strings
title: '[CI] Update Localizations'
body: |
Automated localization update from Crowdin.
labels: |
localization
automated
draft: false
30 changes: 30 additions & 0 deletions .github/workflows/crowdin_push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Push Strings to Crowdin

on:
push:
branches: [ develop ]
workflow_dispatch:
inputs:
test:
description: Just to force the manual trigger
required: false
default: 'trigger'
jobs:
synchronize-with-crowdin:
runs-on: macos-14
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Crowdin CLI
run: brew install crowdin
shell: sh

- name: Upload Sources
run: >
crowdin upload sources
shell: sh
env:
GITHUB_TOKEN: ${{ secrets.CROWDIN_GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
39 changes: 39 additions & 0 deletions .github/workflows/on_pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: On pull request
on:
workflow_dispatch:
pull_request:
branches:
- develop

jobs:
on_pull_request:
runs-on: macos-14
steps:
- uses: actions/checkout@v4

- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.FASTLANE_MATCH_GIT_PRIVATE_KEY }}
known_hosts: ${{ secrets.MATCH_SSH_KNOWN_HOSTS }}
name: id_rsa_match

- name: Set up Ruby environment
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0

- name: Install bundler
run: gem install bundler

- name: Install dependencies
run: bundle install

- name: Install SwiftLint
run: brew install swiftlint

- name: Run Unit and UI tests
uses: ./.github/workflows/actions/run_lane
with:
lane: test_unit_ui
match_password: ${{ secrets.MATCH_PASSWORD }}
25 changes: 25 additions & 0 deletions .github/workflows/on_release_push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: On release push
on:
push:
branches:
- release.**
jobs:
on_release_push:
runs-on: macos-14
steps:
- uses: actions/checkout@v4

- name: Run Unit and UI tests
uses: ./.github/workflows/actions/run_lane
with:
lane: test_unit_ui
match_password: ${{ secrets.MATCH_PASSWORD }}

- name: Commit translation file if changed
uses: ./.github/workflows/actions/xliff_export

- name: Build and deploy to TestFlight
uses: ./.github/workflows/actions/run_lane
with:
lane: build_deploy_testflight
match_password: ${{ secrets.MATCH_PASSWORD }}
Loading

0 comments on commit 0d373a4

Please sign in to comment.