fix vscode bugs (#558) #212
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 | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
release: | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-ecosystem/action-regex-match@v2 | |
id: version-number | |
with: | |
text: ${{ github.event.head_commit.message }} | |
regex: '^Release (\d+\.\d+\.\d+)' | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install setuptools wheel twine | |
- name: Set Prod conf.ini | |
run: | | |
mv mentat/resources/conf/conf-prod.ini mentat/resources/conf/conf.ini | |
- name: Github Release | |
if: ${{ steps.version-number.outputs.match != '' }} | |
continue-on-error: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: >- | |
gh release create "v${{ steps.version-number.outputs.group1 }}" | |
--generate-notes | |
--title "Version ${{ steps.version-number.outputs.group1 }}" | |
- name: PyPi Release | |
if: ${{ steps.version-number.outputs.match != '' }} | |
continue-on-error: true | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
run: | | |
python setup.py sdist bdist_wheel | |
twine upload dist/* | |
- name: Brew Release | |
# Since Homebrew automatically updates from PyPI, no need for us to run this | |
if: ${{ steps.version-number.outputs.match != '' }} && false | |
continue-on-error: true | |
uses: dawidd6/action-homebrew-bump-formula@v3 | |
with: | |
token: ${{ secrets.TOKEN_FOR_BREW }} | |
formula: mentat | |
tag: v${{ steps.version-number.outputs.group1 }} |