Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use GH Actions for CI #262

Merged
merged 13 commits into from
Dec 7, 2023
Merged
66 changes: 57 additions & 9 deletions .github/actions/macos-build/action.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#Xamarin.Mac -> 6.12
#iOS 16.2 -> 16.4
#macOS (Cocoa) 9.1 -> 9.3
#.NET -> 6.0
#.NET -> 7.0
#Visual Studio 17.5 -> 17.6
name: Build for macOS
description: Core build steps for macOS
inputs:
Expand All @@ -9,23 +15,65 @@ inputs:
description: A string to tag the build artifact, like "Debug" or "MAS"
required: false
default: ""
ac_username:
AC_USERNAME:
description: App Store Connect user name
required: true
required: false
default: ""
ac_password:
AC_PASSWORD:
description: App Store Connect password
required: true
default: "secret"
required: false
default: "not set"
MATCH_GIT_URL:
description: Git repository URL for Fastlane Match
required: false
default: ""
MATCH_PASSWORD:
description: Password for Fastlane Match storage
required: false
default: "not set"
MATCH_STORAGE_MODE:
description: Storage mode for Fastlane Match
required: false
default: "git"
runs:
using: composite
steps:
- name: Build Safari helper
env:
AC_USERNAME: ${{ inputs.ac_username }}
AC_PASSWORD: ${{ inputs.ac_password }}
# Note that runs.env doesn't work in composite actions
- name: Setup environment variables
shell: bash
run: |
cat >> $GITHUB_ENV <<EOF
AC_USERNAME=${{ inputs.AC_USERNAME }}
AC_PASSWORD=${{ inputs.AC_PASSWORD }}
MATCH_GIT_URL=${{ inputs.MATCH_GIT_URL }}
MATCH_PASSWORD=${{ inputs.MATCH_PASSWORD }}
MATCH_STORAGE_MODE=${{ inputs.MATCH_STORAGE_MODE }}
EOF
- name: Set Xcode version
shell: bash
run: |
XCODE_ROOT=/Applications/Xcode_14.2.app
echo "MD_APPLE_SDK_ROOT=$XCODE_ROOT" >> $GITHUB_ENV
sudo xcode-select -s $XCODE_ROOT
- name: Build Safari helper # do this early to fail faster
shell: bash
run: xcodebuild -project "Scratch Link Safari Helper/Scratch Link Safari Helper.xcodeproj" -scheme "Scratch Link Safari Helper" clean build
- name: Setup Xamarin
shell: bash
run: |
#cat "$VM_ASSETS/select-xamarin-sdk-v2.sh"
$VM_ASSETS/select-xamarin-sdk-v2.sh --mono=6.12 --mac=9.1 --ios=16.2
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- uses: actions/cache@v3
with:
path: ~/.nuget/packages
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget
- name: "Build for Mac: ${{ inputs.configuration }}"
env:
CONFIG: Debug
Expand Down
20 changes: 16 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,30 @@ jobs:
git pull --tags semantic-release ${{ github.ref_name }}
git fetch semantic-release 'refs/notes/*:refs/notes/*' # semantic-release tracks channels with notes

- uses: ./.github/actions/macos-build
if: runner.os == 'macOS'
- uses: ./.github/actions/windows-build
if: runner.os == 'Windows'
- if: runner.os == 'macOS'
uses: ./.github/actions/macos-build
with:
configuration: Debug
artifact_tag: Debug
AC_USERNAME: ${{ secrets.AC_USERNAME }}
AC_PASSWORD: ${{ secrets.AC_PASSWORD }}
Comment on lines +168 to +169
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the AC_USERNAME and AC_PASSWORD the same for scratch-desktop? I have these set in repository secrets as well, but if they are the same we should probably move them to org secrets.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that would make sense!

MATCH_GIT_URL: ${{ secrets.MATCH_GIT_URL }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
- if: runner.os == 'Windows'
uses: ./.github/actions/windows-build
with:
configuration: Debug
artifact_tag: Debug

- uses: actions/upload-artifact@v3
with:
path: Artifacts/
finish:
if: always() # even if the build fails
runs-on: ubuntu-latest
needs: build
steps:
- uses: geekyeggo/delete-artifact@v2
with:
name: semantic-release-remote
failOnError: false
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,7 @@
};
696FF135289DAECB000D3C3F /* Release_MAS */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 699401DD289DA67700A46D3F /* Release_MAS.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
Expand Down Expand Up @@ -601,6 +602,7 @@
};
696FF136289DAECB000D3C3F /* Release_MAS */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 699401DD289DA67700A46D3F /* Release_MAS.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
Expand All @@ -614,6 +616,7 @@
};
696FF137289DAECB000D3C3F /* Release_MAS */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 699401DD289DA67700A46D3F /* Release_MAS.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -626,6 +629,7 @@
};
696FF138289DAECB000D3C3F /* Release_MAS */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 699401DD289DA67700A46D3F /* Release_MAS.xcconfig */;
buildSettings = {
CODE_SIGN_ENTITLEMENTS = "Scratch Link Safari Extension/Scratch_Link_Safari_Extension.entitlements";
ENABLE_HARDENED_RUNTIME = YES;
Expand Down Expand Up @@ -703,6 +707,7 @@
};
696FF13A289DAED8000D3C3F /* Release_DevID */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 699401DC289DA65C00A46D3F /* Release_DevID.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
Expand Down Expand Up @@ -732,6 +737,7 @@
};
696FF13B289DAED8000D3C3F /* Release_DevID */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 699401DC289DA65C00A46D3F /* Release_DevID.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
Expand All @@ -745,6 +751,7 @@
};
696FF13C289DAED8000D3C3F /* Release_DevID */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 699401DC289DA65C00A46D3F /* Release_DevID.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -757,6 +764,7 @@
};
696FF13D289DAED8000D3C3F /* Release_DevID */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 699401DC289DA65C00A46D3F /* Release_DevID.xcconfig */;
buildSettings = {
CODE_SIGN_ENTITLEMENTS = "Scratch Link Safari Extension/Scratch_Link_Safari_Extension.entitlements";
ENABLE_HARDENED_RUNTIME = YES;
Expand Down Expand Up @@ -887,6 +895,7 @@
};
69E9620127E28B88008CF7C0 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 699401D9289DA5E600A46D3F /* Debug.xcconfig */;
buildSettings = {
CODE_SIGN_ENTITLEMENTS = "Scratch Link Safari Extension/Scratch_Link_Safari_Extension.entitlements";
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -911,6 +920,7 @@
};
69E9620227E28B88008CF7C0 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 699401DB289DA64100A46D3F /* Release.xcconfig */;
buildSettings = {
CODE_SIGN_ENTITLEMENTS = "Scratch Link Safari Extension/Scratch_Link_Safari_Extension.entitlements";
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -935,6 +945,7 @@
};
69E9620527E28B88008CF7C0 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 699401D9289DA5E600A46D3F /* Debug.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
Expand Down Expand Up @@ -964,6 +975,7 @@
};
69E9620627E28B88008CF7C0 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 699401DB289DA64100A46D3F /* Release.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
Expand Down Expand Up @@ -993,6 +1005,7 @@
};
69E9620827E28B88008CF7C0 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 699401D9289DA5E600A46D3F /* Debug.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
Expand All @@ -1006,6 +1019,7 @@
};
69E9620927E28B88008CF7C0 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 699401DB289DA64100A46D3F /* Release.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
Expand All @@ -1019,6 +1033,7 @@
};
69E9620B27E28B88008CF7C0 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 699401D9289DA5E600A46D3F /* Debug.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -1031,6 +1046,7 @@
};
69E9620C27E28B88008CF7C0 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 699401DB289DA64100A46D3F /* Release.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -1053,7 +1069,7 @@
696FF134289DAECB000D3C3F /* Release_MAS */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
defaultConfigurationName = Debug;
};
69E9620027E28B88008CF7C0 /* Build configuration list for PBXNativeTarget "Scratch Link Safari Extension" */ = {
isa = XCConfigurationList;
Expand All @@ -1064,7 +1080,7 @@
696FF138289DAECB000D3C3F /* Release_MAS */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
defaultConfigurationName = Debug;
};
69E9620427E28B88008CF7C0 /* Build configuration list for PBXNativeTarget "Scratch Link Safari Helper" */ = {
isa = XCConfigurationList;
Expand All @@ -1075,7 +1091,7 @@
696FF135289DAECB000D3C3F /* Release_MAS */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
defaultConfigurationName = Debug;
};
69E9620727E28B88008CF7C0 /* Build configuration list for PBXNativeTarget "Scratch Link Safari HelperTests" */ = {
isa = XCConfigurationList;
Expand All @@ -1086,7 +1102,7 @@
696FF136289DAECB000D3C3F /* Release_MAS */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
defaultConfigurationName = Debug;
};
69E9620A27E28B88008CF7C0 /* Build configuration list for PBXNativeTarget "Scratch Link Safari HelperUITests" */ = {
isa = XCConfigurationList;
Expand All @@ -1097,7 +1113,7 @@
696FF137289DAECB000D3C3F /* Release_MAS */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
defaultConfigurationName = Debug;
};
/* End XCConfigurationList section */
};
Expand Down