Skip to content

Commit 82a23c1

Browse files
author
Di Wu
authored
chore: kickoff release
2 parents 3a79531 + 6b67b66 commit 82a23c1

File tree

52 files changed

+60526
-757
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+60526
-757
lines changed

.circleci/config.yml

Lines changed: 0 additions & 723 deletions
This file was deleted.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: 'Run xcodebuild'
2+
description: 'Action runs `xcodebuild build` for the scheme specified'
3+
4+
inputs:
5+
scheme:
6+
required: true
7+
type: string
8+
project_path:
9+
required: false
10+
type: string
11+
xcode_path:
12+
required: false
13+
type: string
14+
destination:
15+
required: false
16+
type: string
17+
default: 'platform=iOS Simulator,name=iPhone 13,OS=latest'
18+
sdk:
19+
required: false
20+
type: string
21+
default: 'iphonesimulator'
22+
other_flags:
23+
required: false
24+
type: string
25+
default: ''
26+
27+
runs:
28+
using: "composite"
29+
steps:
30+
- name: Test ${{ inputs.scheme }}
31+
env:
32+
SCHEME: ${{ inputs.scheme }}
33+
PROJECT_PATH: ${{ inputs.project_path }}
34+
XCODE_PATH: ${{ inputs.xcode_path }}
35+
run: |
36+
if [ ! -z "$PROJECT_PATH" ]; then
37+
cd $PROJECT_PATH
38+
fi
39+
if [ ! -z "$XCODE_PATH" ]; then
40+
sudo xcode-select -s $XCODE_PATH
41+
fi
42+
xcodebuild -version
43+
xcodebuild build -scheme $SCHEME -sdk '${{ inputs.sdk }}' -destination '${{ inputs.destination }}' ${{ inputs.other_flags }} | xcpretty --simple --color --report junit && exit ${PIPESTATUS[0]}
44+
shell: bash

.github/composite_actions/run_xcodebuild_test/action.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ runs:
3333
PROJECT_PATH: ${{ inputs.project_path }}
3434
XCODE_PATH: ${{ inputs.xcode_path }}
3535
run: |
36-
cd $PROJECT_PATH
36+
if [ ! -z "$PROJECT_PATH" ]; then
37+
cd $PROJECT_PATH
38+
fi
3739
if [ ! -z "$XCODE_PATH" ]; then
3840
sudo xcode-select -s $XCODE_PATH
3941
fi
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Build | Amplify Swift
2+
on:
3+
workflow_call:
4+
workflow_dispatch:
5+
push:
6+
branches-ignore:
7+
- main
8+
- release
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
build-amplify-swift-iOS:
15+
runs-on: macos-13
16+
steps:
17+
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
18+
with:
19+
persist-credentials: false
20+
- name: Build Amplify Swift for iOS
21+
uses: ./.github/composite_actions/run_xcodebuild
22+
with:
23+
scheme: Amplify-Package
24+
xcode_path: '/Applications/Xcode_14.3.app'
25+
26+
build-amplify-swift-macOS:
27+
runs-on: macos-13
28+
steps:
29+
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
30+
with:
31+
persist-credentials: false
32+
- name: Build Amplify Swift for macOS
33+
uses: ./.github/composite_actions/run_xcodebuild
34+
with:
35+
scheme: Amplify-Package
36+
destination: platform=macOS,arch=x86_64
37+
sdk: macosx
38+
xcode_path: '/Applications/Xcode_14.3.app'
39+
40+
build-amplify-swift-tvOS:
41+
runs-on: macos-13
42+
steps:
43+
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
44+
with:
45+
persist-credentials: false
46+
- name: Build Amplify Swift for tvOS
47+
uses: ./.github/composite_actions/run_xcodebuild
48+
with:
49+
scheme: Amplify-Package
50+
destination: platform=tvOS Simulator,name=Apple TV 4K (3rd generation),OS=latest
51+
sdk: appletvsimulator
52+
xcode_path: '/Applications/Xcode_14.3.app'
53+
54+
build-amplify-swift-watchOS:
55+
runs-on: macos-13
56+
steps:
57+
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
58+
with:
59+
persist-credentials: false
60+
- name: Build Amplify Swift for watchOS
61+
uses: ./.github/composite_actions/run_xcodebuild
62+
with:
63+
scheme: Amplify-Package
64+
destination: platform=watchOS Simulator,name=Apple Watch Series 8 (45mm),OS=latest
65+
sdk: watchsimulator
66+
xcode_path: '/Applications/Xcode_14.3.app'
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Deploy Package
2+
on:
3+
workflow_call:
4+
inputs:
5+
type:
6+
description: 'The type of deployment. Valid values are unstable (default) and release'
7+
default: 'unstable'
8+
required: false
9+
type: string
10+
11+
permissions:
12+
id-token: write
13+
contents: write
14+
15+
jobs:
16+
unit-tests:
17+
name: Run Plugins Unit Tests
18+
uses: ./.github/workflows/unit_test.yml
19+
20+
fortify:
21+
name: Run Fortify Scan
22+
uses: ./.github/workflows/fortify_scan.yml
23+
secrets: inherit
24+
25+
release:
26+
environment: Release
27+
name: Release new ${{ inputs.type }} version
28+
needs: [unit-tests, fortify]
29+
runs-on: macos-latest
30+
steps:
31+
- name: Configure AWS credentials
32+
uses: aws-actions/configure-aws-credentials@5fd3084fc36e372ff1fff382a39b10d03659f355 #v2
33+
with:
34+
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
35+
role-session-name: ${{ format('{0}.release', github.run_id) }}
36+
aws-region: ${{ secrets.AWS_REGION }}
37+
38+
- id: retrieve-token
39+
name: Retrieve Token
40+
env:
41+
DEPLOY_SECRET_ARN: ${{ secrets.DEPLOY_SECRET_ARN }}
42+
run: |
43+
PAT=$(aws secretsmanager get-secret-value \
44+
--secret-id "$DEPLOY_SECRET_ARN" \
45+
| jq -r ".SecretString | fromjson | .Credential")
46+
echo "token=$PAT" >> $GITHUB_OUTPUT
47+
48+
- name: Checkout repo
49+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
50+
with:
51+
fetch-depth: 10
52+
token: ${{steps.retrieve-token.outputs.token}}
53+
54+
- name: Setup Ruby
55+
uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939 # v1.152.0
56+
with:
57+
ruby-version: '3.2.1'
58+
bundler-cache: true
59+
60+
- name: Release Package
61+
env:
62+
GITHUB_EMAIL: [email protected]
63+
GITHUB_USER: aws-amplify-ops
64+
run: bundle exec fastlane ${{ inputs.type }}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Build, Test and Release | Stable version
2+
on:
3+
push:
4+
branches:
5+
release
6+
7+
permissions:
8+
id-token: write
9+
contents: write
10+
11+
jobs:
12+
release-stable:
13+
uses: ./.github/workflows/deploy_package.yml
14+
with:
15+
type: release
16+
secrets: inherit
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Build, Test and Release | Unstable version
2+
on:
3+
push:
4+
branches:
5+
main
6+
7+
permissions:
8+
id-token: write
9+
contents: write
10+
11+
jobs:
12+
release-unstable:
13+
uses: ./.github/workflows/deploy_package.yml
14+
with:
15+
type: unstable
16+
secrets: inherit

.github/workflows/fortify_scan.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Fortify Scan
2+
on:
3+
workflow_dispatch:
4+
workflow_call:
5+
push:
6+
branches-ignore:
7+
- main
8+
- release
9+
10+
permissions:
11+
id-token: write
12+
contents: read
13+
14+
jobs:
15+
fortify-scan:
16+
runs-on: macos-latest
17+
environment: Fortify
18+
steps:
19+
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
20+
with:
21+
persist-credentials: false
22+
23+
- name: Make source directory
24+
run: |
25+
mkdir source
26+
cp -r Amplify source
27+
cp -r AmplifyPlugins source
28+
- name: Configure AWS credentials for fetching fortify resources
29+
uses: aws-actions/configure-aws-credentials@05b148adc31e091bafbaf404f745055d4d3bc9d2 # Pin to 1.6.1
30+
with:
31+
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
32+
aws-region: ${{ secrets.AWS_REGION }}
33+
role-session-name: GHAFortifySession
34+
role-duration-seconds: 900
35+
36+
- name: Download License
37+
run: |
38+
aws s3 cp s3://${{ secrets.AWS_S3_FORTIFY_BUCKET }}${{ vars.LICENSE_PATH }} fortify.license
39+
40+
- name: Download Installer
41+
run: |
42+
aws s3 cp s3://${{ secrets.AWS_S3_FORTIFY_BUCKET }}${{ vars.INSTALLER_PATH }} Fortify_SCA_and_Apps_22.1.1_Mac.tar.gz
43+
tar -xvf Fortify_SCA_and_Apps_22.1.1_Mac.tar.gz
44+
unzip Fortify_SCA_and_Apps_22.1.1_osx_x64.app.zip
45+
46+
- name: Download Scripts
47+
run: |
48+
aws s3 cp s3://${{ secrets.AWS_S3_FORTIFY_BUCKET }}${{ vars.SCRIPTS_PATH }} fortify_scan.sh
49+
50+
- name: Run Installer
51+
run: |
52+
Fortify_SCA_and_Apps_22.1.1_osx_x64.app/Contents/MacOS/installbuilder.sh --mode unattended --installdir ~/amplify-swift/Fortify --InstallSamples 0 --fortify_license_path fortify.license --MigrateSCA 0
53+
export PATH=~/amplify-swift/Fortify/bin:$PATH
54+
fortifyupdate -acceptKey
55+
sourceanalyzer -version
56+
57+
- name: Run Scan
58+
run: |
59+
export PATH=~/amplify-swift/Fortify/bin:$PATH
60+
sh ./fortify_scan.sh source

.github/workflows/integ_test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Integration Tests
22
on:
33
workflow_dispatch:
4+
workflow_call:
45
push:
56
branches: [main]
67

.github/workflows/release_kickoff.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Creates a PR to push main to release branch to kick-off the CircleCI release workflow
1+
# Creates a PR to push main to release branch to kick-off the release workflow
22
name: Release Amplify iOS
33

44
on:

0 commit comments

Comments
 (0)