Generate Latest API Version #88
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: Generate Latest API Version | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: macOS-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Install Ruby | |
uses: ruby/setup-ruby@v1 | |
- name: Install bundler | |
run: gem install bundler | |
- name: Install dependencies | |
run: bundle install | |
- name: Get API Version | |
id: version | |
run: | | |
API_VERSION="$(./Scripts/get_api_version)" | |
BRANCH_NAME="release/${API_VERSION}-auto-generated" | |
echo "API_VERSION=$API_VERSION" >> $GITHUB_ENV | |
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV | |
- name: Create and push the release branch | |
run: | | |
git checkout -B $BRANCH_NAME # -B will reset branch if it exists | |
git push --set-upstream --force origin $BRANCH_NAME | |
- name: Build new SDK version | |
run: | | |
echo "Generating schema for $API_VERSION" | |
./Scripts/build $API_VERSION | |
git add ./Buy/Generated | |
git config user.name "${GITHUB_ACTOR}" | |
git config user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com" | |
git commit -m "Update schema for `${API_VERSION}` version." | |
git push --set-upstream --force origin $BRANCH_NAME | |
- name: Create pull request | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const api_version = process.env.API_VERSION | |
const branch_name = process.env.BRANCH_NAME | |
github.pulls.create({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
title: "Update Schema to `" + api_version + "` Release", | |
head: branch_name, | |
base: 'main', | |
body: "### Release notes" + | |
"\n" + | |
`\nThe [latest schema changes](https://shopify.dev/api/release-notes/${api_version}#graphql-storefront-api-changes).` + | |
"\n" + | |
"\n#### Steps to release" + | |
"\n- [ ] Tests are passing" + | |
"\n- [ ] Update the [Buy SDK and Library Releases spreadsheet](https://docs.google.com/spreadsheets/d/1WZ8dEl9dQQ6O3ZmBpvq3x-25pBUzN7J6fyj6GnVdS0Q) with the new SDK version" + | |
"\n- [ ] After merging this PR, remember to manually publish the [generated release](https://github.com/Shopify/mobile-buy-sdk-ios/releases)" | |
}) | |
- name: Increment SDK version | |
run: | | |
./Scripts/increment_version | |
git add ./Buy/Utilities/SDK.swift | |
git add ./Mobile-Buy-SDK.podspec | |
git add ./\*Info.plist | |
git add | |
git commit -m "Bump version" | |
git push --set-upstream --force origin $BRANCH_NAME |