Skip to content

trying to fix CI

trying to fix CI #16

name: Release new version
on:
push:
branches:
- main
jobs:
release-action:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Get commit message
id: get_commit_message
run: |
COMMIT_MESSAGE=$(git log -1 --pretty=format:"%s")
echo "commit_message=$COMMIT_MESSAGE" >> $GITHUB_ENV
- name: Extract version string
id: extract_version
run: |
if [[ "$commit_message" =~ ^\[pre-release\]\ \[([0-9]+\.[0-9]+\.[0-9]+)\] ]]; then
VERSION="${BASH_REMATCH[1]}"
echo "version=$VERSION" >> $GITHUB_ENV
else
echo "Commit message does not match the pre-release pattern, exiting..."
exit 0
fi
continue-on-error: true
- name: Setup python
uses: getsentry/[email protected]
with:
python-version: 3.10.7
cache-dependency-path: ./documentation/requirements.txt
install-cmd: pip install -r ./documentation/requirements.txt
venv-dir: ./documentation/.venv
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- name: Publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_KEY }}
run: |
chmod +x ./etc/publish_new_version.sh
export NODE_AUTH_TOKEN=${{ secrets.NPM_KEY }}
./etc/publish_new_version.sh ${{ env.version }}
- name: Update docs
run: |
npm i
npm run generate
working-directory: ./documentation
- name: Update version in git
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: '${{ env.version }} release'
tagging_message: ${{ env.version }}
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./documentation/site