Skip to content

Commit

Permalink
chore: kickoff release
Browse files Browse the repository at this point in the history
  • Loading branch information
phantumcode authored Dec 11, 2023
2 parents f970384 + 4be0d8f commit b7879ad
Show file tree
Hide file tree
Showing 8 changed files with 180 additions and 139 deletions.
115 changes: 0 additions & 115 deletions .circleci/config.yml

This file was deleted.

89 changes: 89 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Build and Test
on:
workflow_call:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main

permissions:
contents: read

concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
build-test-ios:
runs-on: macos-latest
steps:
- name: Checkout repo
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
persist-credentials: false

- name: Setup Ruby
uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939 # v1.152.0
with:
ruby-version: '3.2.1'
bundler-cache: true

- name: Run unit tests
run: bundle exec fastlane ios tests

- name: Run integration tests
run: bundle exec fastlane ios integration_tests

build-test-macos:
runs-on: macos-latest
steps:
- name: Checkout repo
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
persist-credentials: false

- name: Setup Ruby
uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939 # v1.152.0
with:
ruby-version: '3.2.1'
bundler-cache: true

- name: Run unit tests
run: bundle exec fastlane mac tests

build-test-tvos:
runs-on: macos-latest
steps:
- name: Checkout repo
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
persist-credentials: false

- name: Setup Ruby
uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939 # v1.152.0
with:
ruby-version: '3.2.1'
bundler-cache: true

- name: Run unit tests
run: bundle exec fastlane tvos tests

build-test-watchos:
runs-on: macos-latest
steps:
- name: Checkout repo
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
persist-credentials: false

- name: Setup Ruby
uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939 # v1.152.0
with:
ruby-version: '3.2.1'
bundler-cache: true

- name: Run unit tests
run: bundle exec fastlane watchos tests
24 changes: 24 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Dependency Review

on:
pull_request:
branches:
- main

permissions:
contents: read

jobs:
dependency-review:
name: Dependency Review
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
persist-credentials: false

- name: Dependency Review
uses: actions/dependency-review-action@7d90b4f05fea31dde1c4a1fb3fa787e197ea93ab # v3.0.7
with:
config-file: aws-amplify/amplify-ci-support/.github/dependency-review-config.yml@main
2 changes: 1 addition & 1 deletion .github/workflows/release-kickoff.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release new version
name: Kick off new release

on:
workflow_dispatch
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Release new version
on:
push:
branches:
- release

permissions:
id-token: write
contents: write
jobs:
build-and-test:
uses: ./.github/workflows/build-and-test.yml

release:
environment: Release
needs: [build-and-test]
runs-on: macos-latest
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@5fd3084fc36e372ff1fff382a39b10d03659f355 #v2
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
role-session-name: ${{ format('{0}.release', github.run_id) }}
aws-region: ${{ secrets.AWS_REGION }}

- id: retrieve-token
name: Retrieve Token
env:
DEPLOY_SECRET_ARN: ${{ secrets.DEPLOY_SECRET_ARN }}
run: |
PAT=$(aws secretsmanager get-secret-value \
--secret-id "$DEPLOY_SECRET_ARN" \
| jq -r ".SecretString | fromjson | .Credential")
echo "token=$PAT" >> $GITHUB_OUTPUT
- name: Checkout repo
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
fetch-depth: 10
token: ${{steps.retrieve-token.outputs.token}}

- name: Setup Ruby
uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939 # v1.152.0
with:
ruby-version: '3.2.1'
bundler-cache: true

- name: Fetch tags
run: git fetch --tags origin

- name: Publish new version to cocoapods trunk
env:
COCOAPODS_SECRET_ARN: ${{ secrets.COCOAPODS_SECRET_ARN }}
GITHUB_EMAIL: [email protected]
GITHUB_USER: aws-amplify-ops
run: bundle exec fastlane ios release

- name: Publish documentation
run: bundle exec fastlane ios publish_doc
8 changes: 4 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GEM
specs:
CFPropertyList (3.0.6)
rexml
activesupport (6.1.7.3)
activesupport (6.1.7.6)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
Expand Down Expand Up @@ -209,7 +209,7 @@ GEM
http-cookie (1.0.5)
domain_name (~> 0.5)
httpclient (2.8.3)
i18n (1.12.0)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
jazzy (0.14.3)
cocoapods (~> 1.5)
Expand All @@ -229,7 +229,7 @@ GEM
mini_magick (4.12.0)
mini_mime (1.1.2)
mini_portile2 (2.8.1)
minitest (5.18.0)
minitest (5.19.0)
molinillo (0.8.0)
multi_json (1.15.0)
multipart-post (2.0.0)
Expand Down Expand Up @@ -300,7 +300,7 @@ GEM
rouge (~> 2.0.7)
xcpretty-travis-formatter (1.0.1)
xcpretty (~> 0.2, >= 0.0.7)
zeitwerk (2.6.7)
zeitwerk (2.6.11)

PLATFORMS
ruby
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import UserNotifications

#if canImport(WatchKit)
import WatchKit
#elseif canImport(AppKit)
import AppKit
typealias Application = NSApplication
#elseif canImport(UIKit)
import UIKit
typealias Application = UIApplication
#elseif canImport(AppKit)
import AppKit
typealias Application = NSApplication
#endif

@available(iOSApplicationExtension, unavailable)
Expand Down
16 changes: 0 additions & 16 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ PODSPEC_PATH = "AmplifyUtilsNotifications.podspec"
CHANGELOG_PATH = "CHANGELOG.md"

platform :ios do
before_all do
setup_circle_ci
end

desc "Run all the tests on iOS"
lane :tests do
run_tests(
Expand Down Expand Up @@ -137,10 +133,6 @@ platform :ios do
end

platform :mac do
before_all do
setup_circle_ci
end

desc "Run all the tests on macOS"
lane :tests do
run_tests(
Expand All @@ -156,10 +148,6 @@ platform :mac do
end

platform :tvos do
before_all do
setup_circle_ci
end

desc "Run all the tests on tvOS"
lane :tests do
run_tests(
Expand All @@ -175,10 +163,6 @@ platform :tvos do
end

platform :watchos do
before_all do
setup_circle_ci
end

desc "Run all the tests on watchOS"
lane :tests do
run_tests(
Expand Down

0 comments on commit b7879ad

Please sign in to comment.