release_binaries #33
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_binaries | |
on: | |
release: | |
types: created | |
jobs: | |
macOS: | |
name: Add macOS binaries to release | |
runs-on: macos-14 | |
env: | |
XCODE_VERSION: ${{ '14.3.1' }} | |
steps: | |
- name: Select Xcode | |
run: "sudo xcode-select -s /Applications/Xcode_$XCODE_VERSION.app" | |
- name: Checkout | |
uses: actions/checkout@v1 | |
- name: Set tag name | |
run: echo "TAG_NAME=$(echo $GITHUB_REF | cut -c 11-)" >> $GITHUB_ENV | |
- name: Build x86_64-apple-macosx | |
run: "rake 'build[release, x86_64-apple-macosx]'" | |
- name: Save x86_64 executable to be lipo'd later | |
run: "mkdir -p tmp && unzip releases/XCRemoteCache.zip -d tmp/xcremotecache-x86_64" | |
- name: Clean releases dir to not conflict with other archs | |
run: "rm -rf releases" | |
- name: Build arm64-apple-macosx | |
run: "rake 'build[release, arm64-apple-macosx]'" | |
- name: Save arm64 executable to be lipo'd later | |
run: "mkdir -p tmp && unzip releases/XCRemoteCache.zip -d tmp/xcremotecache-arm64" | |
- name: Clean releases dir to not conflict with other files to attach | |
run: "rm -rf releases" | |
- name: Zip x86_64-apple-macosx release | |
run: "mkdir -p releases && zip -jr releases/XCRemoteCache-macOS-x86_64-$TAG_NAME.zip LICENSE README.md tmp/xcremotecache-x86_64" | |
- name: Zip arm64-apple-macosx release | |
run: "zip -jr releases/XCRemoteCache-macOS-arm64-$TAG_NAME.zip LICENSE README.md tmp/xcremotecache-arm64" | |
- name: Lipo macOS executables | |
run: "mkdir -p tmp/xcremotecache && ls tmp/xcremotecache-x86_64 | xargs -I {} lipo -create -output tmp/xcremotecache/{} tmp/xcremotecache-x86_64/{} tmp/xcremotecache-arm64/{}" | |
- name: Zip x86_64-arm64-apple-macosx release | |
run: "zip -jr releases/XCRemoteCache-macOS-arm64-x86_64-$TAG_NAME.zip LICENSE README.md tmp/xcremotecache" | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v1-release | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: releases/* | |
file_glob: true | |
tag: ${{ github.ref }} | |
overwrite: true | |
cocoapods: | |
name: Publish CocoaPods plugin | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
defaults: | |
run: | |
working-directory: cocoapods-plugin | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.0' | |
- run: bundle install | |
- name: Publish to RubyGems | |
run: | | |
mkdir -p $HOME/.gem | |
touch $HOME/.gem/credentials | |
chmod 0600 $HOME/.gem/credentials | |
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials | |
gem build *.gemspec | |
CURRENT_VERSION=$(gem list cocoapods-xcremotecache --remote -q | sed 's/[^0-9\.]//g') | |
[ -f cocoapods-xcremotecache-$CURRENT_VERSION.gem ] && echo "Version $CURRENT_VERSION already exists" || gem push *.gem | |
env: | |
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}" |