v0.27.0 #108
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 Studio | |
on: | |
push: | |
# branches: main | |
jobs: | |
check-for-release: | |
runs-on: ubuntu-latest | |
outputs: | |
status: ${{ steps.check_versions.conclusion }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
- name: check commit name | |
id: vars | |
run: | | |
COMMIT_MSG="${{ github.event.head_commit.message }}" | |
COMMIT_TITLE="${COMMIT_MSG%%$'\n'*}" | |
if [[ $COMMIT_TITLE =~ ^(v|Version )[0-9]+\.[0-9]+\.[0-9]+( \(#[0-9]+\))?$ ]] | |
then | |
PACKAGE_VERSION="${COMMIT_TITLE#Version }" | |
PACKAGE_VERSION="${PACKAGE_VERSION#v}" | |
PACKAGE_VERSION="${PACKAGE_VERSION%% *}" | |
echo version=${PACKAGE_VERSION} >> $GITHUB_OUTPUT | |
echo should_continue=1 >> ${GITHUB_OUTPUT} | |
else | |
echo should_continue=0 >> ${GITHUB_OUTPUT} | |
fi | |
- name: check package versions | |
id: check_versions | |
if: steps.vars.outputs.should_continue == 1 | |
run: | | |
if node ./bump-versions.mjs ${{ steps.vars.outputs.version }} &> temp-bump-versions.txt | |
then | |
echo "Package versions did not match ${{ steps.vars.outputs.version }}." | |
exit 1 | |
fi | |
if | |
grep -zq 'bumping studio-plugin.npm ERR! Version not changed' temp-bump-versions.txt && | |
grep -zq 'bumping studio-ui.npm ERR! Version not changed' temp-bump-versions.txt && | |
grep -zq 'bumping studio.npm ERR! Version not changed' temp-bump-versions.txt | |
then | |
if git diff --exit-code | |
then | |
exit 0 | |
fi | |
echo "Found unexpected git diff from running the bump-versions.mjs script." | |
exit 1 | |
fi | |
echo "Error running the bump-version.mjs script." | |
cat temp-bump-versions.txt | |
exit 1 | |
check-linting: | |
needs: check-for-release | |
runs-on: ubuntu-latest | |
if: needs.check-for-release.outputs.status == 'success' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/setup-ci | |
- name: eslint check | |
run: npx eslint --max-warnings=0 . | |
- name: prettier check | |
run: npx prettier --check . | |
- name: cancel workflow | |
if: ${{ failure() }} | |
run: gh run cancel ${{ github.run_id }} | |
run-tests: | |
needs: check-for-release | |
if: needs.check-for-release.outputs.status == 'success' | |
uses: ./.github/workflows/run-tests.yml | |
run-acceptance: | |
needs: check-for-release | |
if: needs.check-for-release.outputs.status == 'success' | |
uses: ./.github/workflows/playwright.yml | |
with: | |
test_script: npm run playwright |