Skip to content

Commit

Permalink
ci: iterating on gh-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
lwouis committed Nov 2, 2024
1 parent be58bc4 commit 63b386f
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 22 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/ci-cd.yml → .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ jobs:
echo "XCODE_BUILD_PATH=DerivedData/Build/Products/Release" >> $GITHUB_ENV
echo "VERSION_FILE=VERSION.txt" >> $GITHUB_ENV
echo "APP_NAME=$(awk -F ' = ' '/PRODUCT_NAME/ { print $2; }' < config/base.xcconfig)" >> $GITHUB_ENV
- name: Run ci-cd.sh
- name: Run print-env.sh
run: |
scripts/print_env.sh
- name: Run ci_cd.sh
env:
APPCENTER_SECRET: ${{ vars.APPCENTER_SECRET }}
FEEDBACK_TOKEN: ${{ vars.FEEDBACK_TOKEN }}
Expand All @@ -51,8 +54,10 @@ jobs:
BUILD_DIR: ${{ github.workspace }}
GITHUB_EVENT_BEFORE: ${{ github.event.before }}
GITHUB_EVENT_AFTER: ${{ github.event.after }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
scripts/ci-cd.sh
scripts/pre_build_checks.sh
scripts/ci_cd.sh
# - name: Deploy to github releases
## env:
## GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ env:
- APP_NAME="$(awk -F ' = ' '/PRODUCT_NAME/ { print $2; }' < config/base.xcconfig)"
- BUILD_DIR="$TRAVIS_BUILD_DIR"
install: true # disable default install
script: scripts/ci-cd.sh
script: scripts/print_env && scripts/pre_build_checks.sh && scripts/ci_cd.sh
before_deploy: if [[ $TRAVIS_TEST_RESULT == 1 ]]; then echo "build failed; exiting to prevent deploy phases"; sleep 2; exit 1; fi
deploy:
provider: releases
Expand Down
12 changes: 8 additions & 4 deletions alt-tab-macos.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@
1C96189E451343DFB9F27C66 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "[email protected]"; sourceTree = "<group>"; };
1C9618B3872558FBDE74D073 /* install_swiftformat.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = install_swiftformat.js; sourceTree = "<group>"; };
1C9618C8080211CBF882E4E0 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "[email protected]"; sourceTree = "<group>"; };
1C9619ABA703AADC5225C494 /* ci-cd.yml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.yaml; path = "ci-cd.yml"; sourceTree = "<group>"; };
1C9619ABA703AADC5225C494 /* ci_cd.yml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.yaml; path = ci_cd.yml; sourceTree = "<group>"; };
1C9619DEB8B7905DBF9A6030 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "[email protected]"; sourceTree = "<group>"; };
1C961A0A3EF637793B0F9B89 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "[email protected]"; sourceTree = "<group>"; };
1C961A9B3F8ABA1ECFDF7C9F /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "[email protected]"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -361,6 +361,7 @@
BF0C864F182B6155A66D241D /* KeyRepeatTimer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KeyRepeatTimer.swift; sourceTree = "<group>"; };
BF0C86C2BB70A8E05D2103CA /* cs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = cs; path = Localizable.strings; sourceTree = "<group>"; };
BF0C86E06A44AC151FEA4903 /* sv */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = sv; path = InfoPlist.strings; sourceTree = "<group>"; };
BF0C8703C7489A44BEC4BCED /* pre_build_checks.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = pre_build_checks.sh; sourceTree = "<group>"; };
BF0C87320241EAE01E38EF53 /* .periphery.yml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.yaml; path = .periphery.yml; sourceTree = "<group>"; };
BF0C87897C24638DDE4A9889 /* app-icons-style.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "app-icons-style.jpg"; sourceTree = "<group>"; };
BF0C87B913292EE53EDE4220 /* menubar-1.svg */ = {isa = PBXFileReference; lastKnownFileType = file.svg; path = "menubar-1.svg"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -399,6 +400,7 @@
BF0C8B2EA9269BA0B79A525F /* sk */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = sk; path = Localizable.strings; sourceTree = "<group>"; };
BF0C8BA452332236D972C60E /* ATShortcut.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ATShortcut.swift; sourceTree = "<group>"; };
BF0C8BED805610C4F9C46A4A /* export_l10n_strings_to_poeditor.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = export_l10n_strings_to_poeditor.sh; sourceTree = "<group>"; };
BF0C8C0FF1B21F5F7CE16B79 /* print_env.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = print_env.sh; sourceTree = "<group>"; };
BF0C8C4E74DCA631A049492A /* preferences-policies.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "preferences-policies.jpg"; sourceTree = "<group>"; };
BF0C8C4F77466FB59071A71F /* sr */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = sr; path = InfoPlist.strings; sourceTree = "<group>"; };
BF0C8C5210ACA9FBFAE9C631 /* preferences-general.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "preferences-general.jpg"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -578,7 +580,7 @@
D04BAD40CE2D3A8AAC3819D0 /* .gitignore */ = {isa = PBXFileReference; lastKnownFileType = file.gitignore; path = .gitignore; sourceTree = "<group>"; };
D04BAD60C97E609A759E721E /* PoliciesTab.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PoliciesTab.swift; sourceTree = "<group>"; };
D04BAD65AA870A49D2F89DBC /* ensure_generated_files_are_up_to_date.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = ensure_generated_files_are_up_to_date.sh; sourceTree = "<group>"; };
D04BAD6700415D6F7C8B2BEE /* ci-cd.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "ci-cd.sh"; sourceTree = "<group>"; };
D04BAD6700415D6F7C8B2BEE /* ci_cd.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = ci_cd.sh; sourceTree = "<group>"; };
D04BAD7008ED1D9CBC147A75 /* pull_request_template.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = pull_request_template.md; sourceTree = "<group>"; };
D04BAD7D8F3CC2C36C8769C6 /* .travis.yml */ = {isa = PBXFileReference; lastKnownFileType = file.yml; path = .travis.yml; sourceTree = "<group>"; };
D04BAD82F652C4ED5D8BF7AE /* 3 windows - 1 line - tall window.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "3 windows - 1 line - tall window.jpg"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -686,7 +688,7 @@
1C961B4542D84D5B6E937B15 /* workflows */ = {
isa = PBXGroup;
children = (
1C9619ABA703AADC5225C494 /* ci-cd.yml */,
1C9619ABA703AADC5225C494 /* ci_cd.yml */,
);
path = workflows;
sourceTree = "<group>";
Expand Down Expand Up @@ -1377,7 +1379,7 @@
D04BAE93A5854C501639C640 /* update_homebrew_cask.sh */,
D04BA0AAAE82C72855DBBA26 /* update_appcast.sh */,
D04BA123744B0C27E9F54B05 /* codesign_sparkle_embedded_apps.sh */,
D04BAD6700415D6F7C8B2BEE /* ci-cd.sh */,
D04BAD6700415D6F7C8B2BEE /* ci_cd.sh */,
D04BA81B25C166EFB3223639 /* extract_l10n_strings.sh */,
D04BA4FB0047656BEA21F1BE /* codesign */,
D04BA19E22F2B73DB785E5DB /* subset_font.sh */,
Expand All @@ -1397,6 +1399,8 @@
1C9618B3872558FBDE74D073 /* install_swiftformat.js */,
1C961AD30050B3BAC2A8EDD4 /* swiftformat.js */,
BF0C8BED805610C4F9C46A4A /* export_l10n_strings_to_poeditor.sh */,
BF0C8C0FF1B21F5F7CE16B79 /* print_env.sh */,
BF0C8703C7489A44BEC4BCED /* pre_build_checks.sh */,
);
path = scripts;
sourceTree = "<group>";
Expand Down
15 changes: 0 additions & 15 deletions scripts/ci-cd.sh → scripts/ci_cd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,6 @@

set -ex

pwd
env | sort
jq --version
xcodebuild -version
xcodebuild -workspace alt-tab-macos.xcworkspace -scheme Release -showBuildSettings | grep SWIFT_VERSION

npm ci
if [ "$TRAVIS" = true ] ; then
npx commitlint-travis
npx commitlint
else
npx commitlint --from "$GITHUB_EVENT_BEFORE" --to "$GITHUB_EVENT_AFTER" --verbose
fi
scripts/ensure_generated_files_are_up_to_date.sh

if [ $IS_RELEASE ]; then
scripts/determine_version.sh
scripts/replace_environment_variables_in_app.sh
Expand Down
12 changes: 12 additions & 0 deletions scripts/pre_build_checks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

set -ex

npm ci
if [ "$TRAVIS" = true ] ; then
npx commitlint-travis
npx commitlint
else
npx commitlint --from "$GITHUB_EVENT_BEFORE" --to "$GITHUB_EVENT_AFTER" --verbose
fi
scripts/ensure_generated_files_are_up_to_date.sh
9 changes: 9 additions & 0 deletions scripts/print_env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

set -ex

pwd
env | sort
jq --version
xcodebuild -version
xcodebuild -workspace alt-tab-macos.xcworkspace -scheme Release -showBuildSettings | grep SWIFT_VERSION

0 comments on commit 63b386f

Please sign in to comment.