Skip to content

Commit

Permalink
ci: enforce pr convention, automated beta track from main (#1705)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeharding authored Nov 12, 2024
1 parent 4d82078 commit 8ec5784
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 15 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: Build, deploy and release
name: build_release

on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
- "test-[0-9]+.[0-9]+.[0-9]+"
branches:
- "main"

jobs:
build_web:
Expand Down Expand Up @@ -200,7 +202,7 @@ jobs:

create_release:
needs: [build_web, build_ios, build_android_play, build_android]
if: startsWith(github.ref_name, 'test-') != true
if: startsWith(github.ref_name, 'test-') != true && startsWith(github.event.ref, 'refs/tags/')
runs-on: ubuntu-latest

permissions:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: build & push docker container
name: docker

on:
push:
branches:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Run e2e tests
name: e2e

on: workflow_dispatch
jobs:
playwright:
name: Run Playwright tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Cut a release
name: release

on:
workflow_dispatch:
Expand All @@ -14,7 +14,6 @@ env:

jobs:
app_build_number:
name: Calculate app build number
runs-on: ubuntu-latest
steps:
- id: calculate
Expand All @@ -27,7 +26,6 @@ jobs:

validate_version:
needs: app_build_number
name: Validate version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_current_version.outputs.version }}
Expand Down Expand Up @@ -55,7 +53,6 @@ jobs:
push_release:
needs: [validate_version, app_build_number]
name: Add version to apps, push release branch and tag
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -92,9 +89,9 @@ jobs:
git config --global user.email "[email protected]"
git config --global user.name "Voyager CI"
git add .
git commit -S -m "Release ${{ needs.validate_version.outputs.version }} (${{ needs.app_build_number.outputs.app_build }})"
git commit -S -m "release: ${{ needs.validate_version.outputs.version }} (${{ needs.app_build_number.outputs.app_build }})"
TAG_NAME="${TAG_PREFIX}${{ needs.validate_version.outputs.version }}"
echo "Creating tag: $TAG_NAME"
git tag "$TAG_NAME"
git tag -s "$TAG_NAME"
git push origin "$RELEASE_BRANCH_PREFIX/${{ needs.validate_version.outputs.version }}"
git push origin "$TAG_NAME"
24 changes: 24 additions & 0 deletions .github/workflows/semantic_pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: semantic_pull_request

on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
main:
if: github.repository == 'aeharding/voyager'
runs-on: ubuntu-latest
steps:
- name: Validate PR title
uses: amannn/action-semantic-pull-request@v5
with:
subjectPattern: ^(?![A-Z]).+$
subjectPatternError: |
The subject "{subject}" found in the pull request title "{title}"
didn't match the configured pattern. Please ensure that the subject
doesn't start with an uppercase character.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10 changes: 6 additions & 4 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ platform :ios do
ipa: ENV['ios_output'],
app_identifier: ENV['app_identifier'],
api_key_path: "authkey.json",
skip_waiting_for_build_processing: true,
changelog: "Upload from GitHub Actions, ref #{ENV['GITHUB_REF']}, sha #{ENV['GITHUB_SHA']}, msg #{ENV['COMMIT_MSG']}"
distribute_external: true,
groups: ["Public Testers"], # want to join? https://testflight.apple.com/join/nWLw1MBM
changelog: "Upload from GitHub Actions, ref #{ENV['GITHUB_REF']}, sha #{ENV['GITHUB_SHA']}, msg #{ENV['COMMIT_MSG']}",
reject_build_waiting_for_review: true,
)
end
end
Expand All @@ -64,9 +66,9 @@ platform :android do
if !ENV['GITHUB_REF_NAME'].start_with?('test-')
upload_to_play_store(
package_name: ENV['app_identifier'],
release_status: 'draft',
json_key: ENV['google_service_account_path'],
aab: Actions.lane_context[SharedValues::GRADLE_AAB_OUTPUT_PATH],
json_key: ENV['google_service_account_path'],
track: 'beta',
skip_upload_apk: true,
skip_upload_metadata: true,
skip_upload_images: true,
Expand Down

0 comments on commit 8ec5784

Please sign in to comment.