-
Notifications
You must be signed in to change notification settings - Fork 244
58 lines (55 loc) · 1.74 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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 }}