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 cb1bc72 commit 997a638
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 71 deletions.
40 changes: 18 additions & 22 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,29 @@ on:
branches:
- master
- test-github-actions
env:
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: ${{ secrets.APPLE_TEAM_ID }}
APPLE_P12_CERTIFICATE: ${{ secrets.APPLE_P12_CERTIFICATE }}
FEEDBACK_TOKEN: ${{ secrets.FEEDBACK_TOKEN }}
NETLIFY_WEBHOOK: ${{ secrets.NETLIFY_WEBHOOK }}
SPARKLE_ED_PRIVATE_KEY: ${{ secrets.SPARKLE_ED_PRIVATE_KEY }}
GITHUB_EVENT_BEFORE: ${{ github.event.before }}
GITHUB_EVENT_AFTER: ${{ github.event.after }}
BUILD_DIR: ${{ github.workspace }}
jobs:
build:
runs-on: macos-12
environment: production
steps:
- name: Dump gitHub context
env:
GITHUB_CONTEXT: ${{ toJSON(github) }}
run: echo "$GITHUB_CONTEXT"
# - name: Dump gitHub context
# env:
# GITHUB_CONTEXT: ${{ toJSON(github) }}
# run: echo "$GITHUB_CONTEXT"
- name: Set up node
uses: actions/setup-node@v3
with:
Expand Down Expand Up @@ -43,28 +57,10 @@ jobs:
run: |
scripts/print_env.sh
- name: Run ci_cd.sh
env:
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: ${{ 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 }}
run: |
scripts/pre_build_checks.sh
scripts/ci_cd.sh
# - name: Deploy to github releases
## env:
## GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# uses: softprops/action-gh-release@v1
# with:
# files: ${{ env.XCODE_BUILD_PATH }}/*.zip
Expand Down
36 changes: 18 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
branches:
only:
- master
- test-github-actions
os: osx
osx_image: xcode13.4
language: node_js
node_js:
- 16
#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
env:
global:
- IS_RELEASE=$(if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then echo true; fi)
- XCODE_BUILD_PATH="DerivedData/Build/Products/Release"
- VERSION_FILE="VERSION.txt"
- 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_vars.sh
#env:
# global:
# - IS_RELEASE=$(if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then echo true; fi)
# - XCODE_BUILD_PATH="DerivedData/Build/Products/Release"
# - VERSION_FILE="VERSION.txt"
# - 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_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:
Expand Down
4 changes: 0 additions & 4 deletions alt-tab-macos.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@
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 @@ -350,7 +349,6 @@
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 @@ -1403,7 +1401,6 @@
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 @@ -1966,7 +1963,6 @@
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
4 changes: 2 additions & 2 deletions scripts/ci_cd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

set -ex

if [ $IS_RELEASE ]; then
#if [ $IS_RELEASE ]; then
scripts/determine_version.sh
scripts/replace_environment_variables_in_app.sh
fi
#fi

scripts/codesign/setup_ci_master.sh
xcodebuild -workspace alt-tab-macos.xcworkspace -scheme Release -derivedDataPath DerivedData
Expand Down
20 changes: 0 additions & 20 deletions scripts/print_env_vars.sh

This file was deleted.

12 changes: 7 additions & 5 deletions scripts/update_homebrew_cask.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
#!/usr/bin/env bash

set -exu
set -ex

brew update
brew install vitorgalvao/tiny-scripts/cask-repair

version="$(cat $VERSION_FILE)"

# add github ssh key
echo "$GITHUB_SSH_KEY" | base64 --decode > github_ssh
chmod 600 github_ssh
ssh-add -K github_ssh
if [ "$TRAVIS" = true ] ; then
# add github ssh key
echo "$GITHUB_SSH_KEY" | base64 --decode > github_ssh
chmod 600 github_ssh
ssh-add -K github_ssh
fi

cask-repair --blind-submit --cask-version "$version" alt-tab

0 comments on commit 997a638

Please sign in to comment.