Skip to content

feat: add checks and debug for sem-release #4

feat: add checks and debug for sem-release

feat: add checks and debug for sem-release #4

Workflow file for this run

name: Release CI
on:
push:
branches: # Create a GitHub release from `main`
- main
pull_request: # Test the workflow without creating a release
branches:
- main
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Prepare semantic release
env:
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}
run: |
# Run in dry-run mode to determine the next tag version and store it in semantic-release-next-version.txt
npx [email protected] --dry-run | tee semantic-release-next-version.txt
NEXT_VERSION=$(
cat semantic-release-next-version.txt | \
grep -o 'Skip v.* tag creation in dry-run mode' \
| sed -e 's/^Skip //' | sed -e 's/ tag creation in dry-run mode$//'
)
echo "DEBUG: Next version is '$NEXT_VERSION'" # Debug version number
if [ -z "$NEXT_VERSION" ]; then
echo "ERROR: Could not determine next version from semantic-release dry-run output."
exit 1
fi
# Hardcode the next tag version in the atlas script
sed -i -e "s/_ATLAS_VERSION=.*/_ATLAS_VERSION=\"$NEXT_VERSION\" # Tagged by release.yml/" atlas
echo "DEBUG: 'atlas --version' output is '$(./atlas --version)'" # Debug version number
- name: Semantic release
env:
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}
if: github.ref == 'refs/heads/main'
run: |
# Actually create the tag and upload the atlas script
npx [email protected]