chore: generated code for commit 21a027bd06e8b69a2f58b7ecb7c0f532e69b… #5
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: generated code for commit')" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get versions | |
id: versions | |
shell: bash | |
run: | | |
echo "SWIFT_VERSION=$(cat clients/algoliasearch-client-swift/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: cd clients/algoliasearch-client-swift && swift package resolve | |
- name: Test Swift package | |
run: cd clients/algoliasearch-client-swift && swift test | |
release: | |
name: Publish on CocoaPods | |
runs-on: ubuntu-22.04 | |
needs: | |
- test_macos | |
if: "startsWith(github.event.head_commit.message, 'chore: generated code for commit')" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get versions | |
id: versions | |
shell: bash | |
run: | | |
echo "RELEASE_VERSION=$(cat clients/algoliasearch-client-swift/AlgoliaSearchClient.podspec | grep s.version | sed 's/ //g' | cut -d \' -f 2)" >> $GITHUB_OUTPUT | |
echo "SWIFT_VERSION=$(cat clients/algoliasearch-client-swift/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: cd clients/algoliasearch-client-swift && swift package resolve | |
- name: Test Swift package on Linux | |
run: cd clients/algoliasearch-client-swift && swift test | |
- name: Install Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.0.3 | |
bundler-cache: true | |
- name: Install CocoaPods | |
run: cd clients/algoliasearch-client-swift && gem install cocoapods | |
- name: Publish on CocoaPods | |
run: | | |
set -eo pipefail | |
pod lib lint --allow-warnings --verbose clients/algoliasearch-client-swift/AlgoliaSearchClient.podspec | |
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 clients/algoliasearch-client-swift/CHANGELOG.md --target ${{ github.sha }} --draft | |
env: | |
GH_TOKEN: ${{ github.token }} |