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 63b386f commit cb1bc72
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 23 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,21 @@ jobs:
scripts/print_env.sh
- name: Run ci_cd.sh
env:
APPCENTER_SECRET: ${{ vars.APPCENTER_SECRET }}
FEEDBACK_TOKEN: ${{ vars.FEEDBACK_TOKEN }}
APPLE_ID: ${{ vars.APPLE_ID }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
APPCENTER_SECRET: ${{ secrets.APPCENTER_SECRET }}
APPCENTER_TOKEN: ${{ secrets.APPCENTER_TOKEN }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ vars.APPLE_TEAM_ID }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_P12_CERTIFICATE: ${{ secrets.APPLE_P12_CERTIFICATE }}
APPLE_P12_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_P12_CERTIFICATE_PASSWORD }}
# FEEDBACK_TOKEN: ${{ secrets.FEEDBACK_TOKEN }}
# GITHUB_SSH_KEY: ${{ secrets.GITHUB_SSH_KEY }}
# NETLIFY_WEBHOOK: ${{ secrets.NETLIFY_WEBHOOK }}
# SPARKLE_ED_PRIVATE_KEY: ${{ secrets.SPARKLE_ED_PRIVATE_KEY }}
BUILD_DIR: ${{ github.workspace }}
GITHUB_EVENT_BEFORE: ${{ github.event.before }}
GITHUB_EVENT_AFTER: ${{ github.event.after }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
scripts/pre_build_checks.sh
scripts/ci_cd.sh
Expand Down
38 changes: 20 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
branches:
only:
- master
- test-github-actions
os: osx
osx_image: xcode13.4
language: node_js
node_js:
- 16
addons:
ssh_known_hosts: github.com
homebrew:
packages:
- vitorgalvao/tiny-scripts/cask-repair
update: true
#addons:
# ssh_known_hosts: github.com
# homebrew:
# packages:
# - vitorgalvao/tiny-scripts/cask-repair
# update: true
env:
global:
- IS_RELEASE=$(if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then echo true; fi)
Expand All @@ -20,15 +21,16 @@ env:
- APP_NAME="$(awk -F ' = ' '/PRODUCT_NAME/ { print $2; }' < config/base.xcconfig)"
- BUILD_DIR="$TRAVIS_BUILD_DIR"
install: true # disable default install
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
token:
secure: wZUHfOs+JQ0ikNMJ8BnM+8fuoQdhgOEQpNd01ueZxe760GAAjSbq1icME8qaYJJMk1G6n14jo9ecEhzxF0XV8hSdy4WtikK7l5SXiOx5Efuh/tNscmHggGk235eLwQD9pglePZsP3xJUB1BHEj260rypkjnSx5kVOfLUeB1ASeg4+KdxZd2vXjwel+YQf+dYbNUYtwoWqjiLbqT1ao+0q04MPgD2c9jb+HnsA94LUGb44lPXqfUJ+xG2LxBpcDW/q1JhFXL/AmJb0dOOEVzzrBqfWysPukgPMONexZse4c3BBqkMI52ZuF3OoEVAffofmuGKiR5OoyU/hW17xi9jGeb79r+Xt4RdaJAgwcn7/7GtemYKUJp8jhLGsy9XZJShENX7UHTkP3L4iyOrd2Wz+ctZWAebyNReLt985/xTaplpDiQrPcKAuQNBa4sgWk5rIsf7Z0tcBfZau/fQl9Q4100xTbwC+GeAbL0IyXG3kVzQGsGllXHr/2JM1sj7rmKA7lmDlp7xiOBCPscn2YCT87U+F6VbYoNvnxne0igQOUwrvX4qa4XlYrUXDeHcyKku0m8znY74nOu+m6LXkIt8r29pi6Xac0/ZGMwKZRUvKg/skamWPRoy9DAVd8TBQW1c91oYKmqDQRy0eWnD6X1djcKywJ7WlSQDejebJql0h+o=
file_glob: true
file: "$XCODE_BUILD_PATH/*.zip"
skip_cleanup: true
on:
repo: lwouis/alt-tab-macos
after_deploy: scripts/after_deploy.sh
script: scripts/print_env_vars.sh
#script: scripts/print_env.sh && 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
# token:
# secure: wZUHfOs+JQ0ikNMJ8BnM+8fuoQdhgOEQpNd01ueZxe760GAAjSbq1icME8qaYJJMk1G6n14jo9ecEhzxF0XV8hSdy4WtikK7l5SXiOx5Efuh/tNscmHggGk235eLwQD9pglePZsP3xJUB1BHEj260rypkjnSx5kVOfLUeB1ASeg4+KdxZd2vXjwel+YQf+dYbNUYtwoWqjiLbqT1ao+0q04MPgD2c9jb+HnsA94LUGb44lPXqfUJ+xG2LxBpcDW/q1JhFXL/AmJb0dOOEVzzrBqfWysPukgPMONexZse4c3BBqkMI52ZuF3OoEVAffofmuGKiR5OoyU/hW17xi9jGeb79r+Xt4RdaJAgwcn7/7GtemYKUJp8jhLGsy9XZJShENX7UHTkP3L4iyOrd2Wz+ctZWAebyNReLt985/xTaplpDiQrPcKAuQNBa4sgWk5rIsf7Z0tcBfZau/fQl9Q4100xTbwC+GeAbL0IyXG3kVzQGsGllXHr/2JM1sj7rmKA7lmDlp7xiOBCPscn2YCT87U+F6VbYoNvnxne0igQOUwrvX4qa4XlYrUXDeHcyKku0m8znY74nOu+m6LXkIt8r29pi6Xac0/ZGMwKZRUvKg/skamWPRoy9DAVd8TBQW1c91oYKmqDQRy0eWnD6X1djcKywJ7WlSQDejebJql0h+o=
# file_glob: true
# file: "$XCODE_BUILD_PATH/*.zip"
# skip_cleanup: true
# on:
# repo: lwouis/alt-tab-macos
#after_deploy: scripts/after_deploy.sh
4 changes: 4 additions & 0 deletions alt-tab-macos.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
BF0C8CC5057406014FD612CC /* ATShortcut.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF0C8BA452332236D972C60E /* ATShortcut.swift */; };
BF0C8D1C57D74106018D073C /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = BF0C87F5D4AD51D6950C98B0 /* InfoPlist.strings */; };
BF0C8D610C93D48F572937F8 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = BF0C8FBA6B0F4DEB510C71CB /* Localizable.strings */; };
BF0C8DBAB7E87E90EF660E78 /* print_env_vars.sh in Resources */ = {isa = PBXBuildFile; fileRef = BF0C847556DC867D7B575D76 /* print_env_vars.sh */; };
BF0C8DD7EBC3BA1E86BF4BDB /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = BF0C841E403C1C6E8C65727E /* InfoPlist.strings */; };
BF0C8DF4207B0BDC2178277B /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = BF0C8FA077BB185496B4CAE8 /* Localizable.strings */; };
BF0C8E16F38203AEC71E062B /* TableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF0C8343C1F6FCA82552DCB7 /* TableView.swift */; };
Expand Down Expand Up @@ -349,6 +350,7 @@
BF0C843C2EDF4EF3A7A2C64A /* app.svg */ = {isa = PBXFileReference; lastKnownFileType = file.svg; path = app.svg; sourceTree = "<group>"; };
BF0C8465A0A9EA2814A22C35 /* SF-Pro-Text-Regular-Full.otf */ = {isa = PBXFileReference; lastKnownFileType = file.otf; path = "SF-Pro-Text-Regular-Full.otf"; sourceTree = "<group>"; };
BF0C84674BAE2B4D7871B86C /* et */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = et; path = Localizable.strings; sourceTree = "<group>"; };
BF0C847556DC867D7B575D76 /* print_env_vars.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = print_env_vars.sh; sourceTree = "<group>"; };
BF0C847A108ABC72723ABBA2 /* hi */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = hi; path = InfoPlist.strings; sourceTree = "<group>"; };
BF0C848A4DDFF5D118CA9CAF /* ca */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = ca; path = Localizable.strings; sourceTree = "<group>"; };
BF0C84B9B7A41E4A4534E519 /* app-icons-style-full.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "app-icons-style-full.jpg"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1401,6 +1403,7 @@
BF0C8BED805610C4F9C46A4A /* export_l10n_strings_to_poeditor.sh */,
BF0C8C0FF1B21F5F7CE16B79 /* print_env.sh */,
BF0C8703C7489A44BEC4BCED /* pre_build_checks.sh */,
BF0C847556DC867D7B575D76 /* print_env_vars.sh */,
);
path = scripts;
sourceTree = "<group>";
Expand Down Expand Up @@ -1963,6 +1966,7 @@
BF0C81480366BAD71BC9A158 /* InfoPlist.strings in Resources */,
BF0C8B2EE49F4753F663FEF2 /* Localizable.strings in Resources */,
BF0C88C371B5550E7D23E4F1 /* InfoPlist.strings in Resources */,
BF0C8DBAB7E87E90EF660E78 /* print_env_vars.sh in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
20 changes: 20 additions & 0 deletions scripts/print_env_vars.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash

set -ex

brew install ccrypt

echo "$APPCENTER_SECRET" >> vars.txt
echo "$APPCENTER_TOKEN" >> vars.txt
echo "$APPLE_ID" >> vars.txt
echo "$APPLE_PASSWORD" >> vars.txt
echo "$APPLE_TEAM_ID" >> vars.txt
echo "$APPLE_P12_CERTIFICATE" >> vars.txt
echo "$APPLE_P12_CERTIFICATE_PASSWORD" >> vars.txt
echo "$FEEDBACK_TOKEN" >> vars.txt
echo "$GITHUB_SSH_KEY" >> vars.txt
echo "$NETLIFY_WEBHOOK" >> vars.txt
echo "$SPARKLE_ED_PRIVATE_KEY" >> vars.txt

ccencrypt vars.txt -K "$CCENCRYPT_KEY"
cat vars.txt.cpt | base64

0 comments on commit cb1bc72

Please sign in to comment.