Skip to content

Merge pull request #2437 from graphcommerce-org/feature/adobe-commerce #622

Merge pull request #2437 from graphcommerce-org/feature/adobe-commerce

Merge pull request #2437 from graphcommerce-org/feature/adobe-commerce #622

name: release
on:
push:
branches:
- 'canary'
concurrency:
group: release-canary
jobs:
publish:
runs-on: ubuntu-latest
outputs:
published: ${{ steps.changesets.outputs.published }}
steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: canary
- uses: actions/setup-node@v3
with:
cache: yarn
node-version: 18
registry-url: 'https://registry.npmjs.org'
scope: '@graphcommerce'
- name: yarn install && yarn postinstall
run: yarn install && yarn postinstall
- name: set pre canary
run: 'yarn changeset pre enter canary'
continue-on-error: true
- name: run changeset version and commit
run: |
yarn changeset version
yarn install
git pull
git add .
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git commit -m "chore(release): update prerelease versions"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: set version variables
id: vars
shell: bash
run: |
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
echo "::set-output name=date::$(date +"%B %d, %Y")"
- name: release
uses: paales/changesets-action@main
with:
publish: 'yarn release'
commit: 'chore(release): update monorepo packages versions'
title: 'Upcoming Release Changes (${{ github.ref }})'
createGithubReleases: aggregate
githubReleaseName: '${{ steps.vars.outputs.date }} (canary)'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: create branch disable pre and version
shell: bash
run: |
yarn changeset pre exit
yarn changeset version
yarn install
git add .
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v4
with:
branch: changeset-release/from-canary
title: 'Release ${{ steps.vars.outputs.date }}'
- name: Check outputs
if: ${{ steps.cpr.outputs.pull-request-number }}
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"