Skip to content

follow up for graphql-codegen dependency pump in examples folder (#2101) #733

follow up for graphql-codegen dependency pump in examples folder (#2101)

follow up for graphql-codegen dependency pump in examples folder (#2101) #733

Workflow file for this run

name: ⏭️ Next Release
on:
push:
branches:
- main
jobs:
next-release:
name: ⏭️ Next Release
runs-on: ubuntu-latest
# don't run if a commit message with [ci] release is present. The release workflow will do the release
if: github.repository_owner == 'shopify' && !startsWith(github.event.head_commit.message, '[ci] release')
outputs:
NEXT_VERSION: ${{ steps.version.outputs.NEXT_VERSION }}
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: ⎔ Setup node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- name: Install the packages
run: npm ci
- name: Format release with Prettier
run: npm run format
- name: 🕵️ Check for changes
id: version
run: |
# get latest commit sha
SHA=$(git rev-parse HEAD)
# get first 7 characters of sha
SHORT_SHA=${SHA::7}
NEXT_VERSION=next-${SHORT_SHA}
# set output so it can be used in other jobs
echo "NEXT_VERSION=${NEXT_VERSION}" >> $GITHUB_OUTPUT
- name: 🏗 Build CLI
if: steps.version.outputs.NEXT_VERSION
run: npm run build
- name: ⤴️ Update version
if: steps.version.outputs.NEXT_VERSION
run: |
git config user.email "hydrogen@shopify.com"
git config user.name "Hydrogen Bot"
git checkout -B next/${{ steps.version.outputs.NEXT_VERSION }}
# using changeset snapshot releases, this sets the version to 0.0.0-{tag}-DATETIMESTAMP where tag=next-SHORT_SHA
# as an example this results in a next release as following 0.0.0-next-1686a75-20230313113149 with a next tag
npm run version:next
npm run changeset -- version --snapshot ${{steps.version.outputs.NEXT_VERSION}}
npm run version:post
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 🏗 Build
if: steps.version.outputs.NEXT_VERSION
run: npm run build
- name: 🔐 Setup npm auth
if: steps.version.outputs.NEXT_VERSION
run: |
echo "registry=https://registry.npmjs.org" >> ~/.npmrc
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: 🚀 Publish
if: steps.version.outputs.NEXT_VERSION
run: npm run changeset -- publish --tag next