Skip to content

Instantly share code, notes, and snippets.

View aChase55's full-sized avatar

Alex Chase aChase55

  • Los Angeles
View GitHub Profile
@aChase55
aChase55 / StringOrInt.swift
Last active July 11, 2019 19:47
StringOrInt Codable
enum StringOrInt: Codable {
case string(String)
case int(Int)
init(from decoder: Decoder) throws {
let container = try decoder.singleValueContainer()
if let value = try? container.decode(Int.self) {
self = .int(value)
return
}
@aChase55
aChase55 / install_gtest_ubuntu.md
Created December 18, 2019 06:37 — forked from Cartexius/install_gtest_ubuntu.md
Install gtest in Ubuntu
@aChase55
aChase55 / export.sh
Created January 16, 2020 02:27
.env export
export $(cat .env.dev | xargs)
@aChase55
aChase55 / nightly.yml
Created October 20, 2022 18:49
nightly build
name: Nightly Build
on:
workflow_dispatch:
schedule:
- cron: '0 0,12 * * *'
jobs:
nightly-build:
uses: ./.github/workflows/tag-builds.yml
secrets: inherit
@aChase55
aChase55 / tag-builds.yml
Created October 20, 2022 18:50
Tag builds
name: Tag Builds
on:
workflow_call:
jobs:
tag-builds:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
@aChase55
aChase55 / tag-filters.yml
Created October 20, 2022 18:51
Tag filters
name: build-upload
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+-[0-9]+-Debug'
- '[0-9]+.[0-9]+.[0-9]+-[0-9]+-Release'
jobs:
build-upload:
runs-on: macos-12
steps:
- name: Check base ref
id: check-base-ref
run: |
REF=${{ github.event.base_ref }}
if ! [[ $REF =~ ^refs/heads/(main|release/.*)$ ]]; then
echo "Deployments via tagging must be done against the main or release branch";
- name: Inject slug/short variables
uses: rlespinasse/[email protected]
- name: Archive and Export
id: build-archive-export
run: ./scripts/build-archive-export.sh
env:
SLUG: ${{ env.GITHUB_REF_SLUG_CS }}
#Slug format is version-build-configuration
VERSION_NUMBER=${SLUG%%-*}
BUILD_AND_VERSION=${SLUG#*-}
BUILD_NUMBER=${BUILD_AND_VERSION%%-*}
BUILD_CONFIGURATION=${SLUG##*-}
if ! [[ "$BUILD_CONFIGURATION" =~ ^(Debug|Release)$ ]]; then
echo "INVALID CONFIGURATION: " $BUILD_CONFIGURATION
exit 1
fi