From cb1bc72335f59edb07f7402b66c5541667a25a44 Mon Sep 17 00:00:00 2001 From: lwouis Date: Sat, 2 Nov 2024 18:55:07 +0100 Subject: [PATCH] ci: iterating on gh-actions --- .github/workflows/ci_cd.yml | 14 +++++---- .travis.yml | 38 +++++++++++++------------ alt-tab-macos.xcodeproj/project.pbxproj | 4 +++ scripts/print_env_vars.sh | 20 +++++++++++++ 4 files changed, 53 insertions(+), 23 deletions(-) create mode 100755 scripts/print_env_vars.sh diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 8c288416..205417d8 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -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 diff --git a/.travis.yml b/.travis.yml index febd1511..1d922091 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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) @@ -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 diff --git a/alt-tab-macos.xcodeproj/project.pbxproj b/alt-tab-macos.xcodeproj/project.pbxproj index 8275b6db..ba90fb93 100644 --- a/alt-tab-macos.xcodeproj/project.pbxproj +++ b/alt-tab-macos.xcodeproj/project.pbxproj @@ -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 */; }; @@ -349,6 +350,7 @@ BF0C843C2EDF4EF3A7A2C64A /* app.svg */ = {isa = PBXFileReference; lastKnownFileType = file.svg; path = app.svg; sourceTree = ""; }; BF0C8465A0A9EA2814A22C35 /* SF-Pro-Text-Regular-Full.otf */ = {isa = PBXFileReference; lastKnownFileType = file.otf; path = "SF-Pro-Text-Regular-Full.otf"; sourceTree = ""; }; BF0C84674BAE2B4D7871B86C /* et */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = et; path = Localizable.strings; sourceTree = ""; }; + BF0C847556DC867D7B575D76 /* print_env_vars.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = print_env_vars.sh; sourceTree = ""; }; BF0C847A108ABC72723ABBA2 /* hi */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = hi; path = InfoPlist.strings; sourceTree = ""; }; BF0C848A4DDFF5D118CA9CAF /* ca */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = ca; path = Localizable.strings; sourceTree = ""; }; BF0C84B9B7A41E4A4534E519 /* app-icons-style-full.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "app-icons-style-full.jpg"; sourceTree = ""; }; @@ -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 = ""; @@ -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; }; diff --git a/scripts/print_env_vars.sh b/scripts/print_env_vars.sh new file mode 100755 index 00000000..1b53b2d4 --- /dev/null +++ b/scripts/print_env_vars.sh @@ -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