chore: generated code for commit 74474bd02398641c8777a6b002442649fcd2… #1
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 package | |
on: | |
push: | |
branches: | |
- generated/feat/swift-release-process | |
jobs: | |
test_macos: | |
name: Test on macOS | |
runs-on: macos-latest | |
if: "startsWith(github.event.head_commit.message, 'chore: test swift release')" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get versions | |
id: versions | |
shell: bash | |
run: | | |
echo "SWIFT_VERSION=$(cat Package.swift | head -n 1 | sed 's/ //g' | cut -d : -f 2)" >> $GITHUB_OUTPUT | |
- name: Install Swift | |
uses: swift-actions/setup-swift@v1 | |
with: | |
swift-version: ${{ steps.versions.outputs.SWIFT_VERSION }} | |
- name: Install Swift dependencies | |
run: swift package resolve | |
- name: Test Swift package | |
run: swift test | |
release: | |
name: Publish on CocoaPods | |
runs-on: ubuntu-22.04 | |
needs: | |
- test_macos | |
if: "startsWith(github.event.head_commit.message, 'chore: test swift release')" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get versions | |
id: versions | |
shell: bash | |
run: | | |
echo "RELEASE_VERSION=$(cat AlgoliaSearchClient.podspec | grep s.version | sed 's/ //g' | cut -d \' -f 2)" >> $GITHUB_OUTPUT | |
echo "SWIFT_VERSION=$(cat Package.swift | head -n 1 | sed 's/ //g' | cut -d : -f 2)" >> $GITHUB_OUTPUT | |
- name: Install Swift | |
uses: swift-actions/setup-swift@v1 | |
with: | |
swift-version: ${{ steps.versions.outputs.SWIFT_VERSION }} | |
- name: Install Swift dependencies | |
run: swift package resolve | |
- name: Test Swift package on Linux | |
run: swift test | |
- name: Install Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.0.3 | |
bundler-cache: true | |
- name: Install CocoaPods | |
run: gem install cocoapods | |
- name: Publish on CocoaPods | |
run: | | |
set -eo pipefail | |
pod trunk push --allow-warnings --verbose | |
env: | |
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} | |
- name: Publish release on Github | |
run: | | |
set -eo pipefail | |
gh release create ${{ steps.versions.outputs.RELEASE_VERSION }} --title ${{ steps.versions.outputs.RELEASE_VERSION }} -F CHANGELOG.md --target ${{ github.sha }} | |
env: | |
GH_TOKEN: ${{ github.token }} |