Release Automation #20
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release macOS | |
on: | |
workflow_run: | |
workflows: [test macOS] | |
types: | |
- completed | |
workflow_dispatch: | |
inputs: | |
ref: | |
description: 'Ref to build (branch, tag or SHA)' | |
required: false | |
default: 'master' | |
pull_request: | |
branches: | |
- master | |
release: | |
types: | |
[ created ] | |
jobs: | |
build: | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
name: Build Sourcery for macOS | |
runs-on: macos-13 | |
steps: | |
- name: Set Xcode 15.1.0 | |
run: sudo xcode-select -s /Applications/Xcode_15.1.0.app/Contents/Developer | |
- name: Print Current Xcode | |
run: xcode-select -p | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.inputs.ref }} | |
- name: Build it | |
run: | | |
BUILD_DIR='${HOME}/build/' | |
CLI_DIR='${HOME}/bin/' | |
output_path="${CLI_DIR}/sourcery" | |
mkdir -p $CLI_DIR | |
swift build --disable-sandbox -c release --arch arm64 --build-path $BUILD_DIR | |
swift build --disable-sandbox -c release --arch x86_64 --build-path $BUILD_DIR | |
lipo -create -output $output_path ${BUILD_DIR}arm64-apple-macosx/release/sourcery ${BUILD_DIR}x86_64-apple-macosx/release/sourcery | |
strip -rSTX ${output_path} | |
mv $output_path "${HOME}/sourcery" | |
- name: 'Upload Artifact' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: sourcery | |
path: ~/sourcery | |
retention-days: 5 | |
# # cat .github/workflows/tests.yml | |
# name: tests | |
# on: [workflow_call] # allow this workflow to be called from other workflows | |
# jobs: | |
# ... | |
# # cat .github/workflows/deploy.yml | |
# name: deploy | |
# on: | |
# push: | |
# tags: # trigger the deploy job on tag creation | |
# - * | |
# jobs: | |
# tests: | |
# uses: ./.github/workflows/tests.yml # use the callable tests job to run tests | |
# deploy: | |
# name: deploy | |
# needs: [tests] # require tests to pass before deploy runs | |
# ... |