-
Notifications
You must be signed in to change notification settings - Fork 414
64 lines (61 loc) · 2.14 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
59
60
61
62
63
64
name: Release
on:
push:
branches:
- master
env:
HUSKY: 0
jobs:
release:
permissions:
contents: write # for release publishing
name: Release
env:
commitmsg: ${{ github.event.head_commit.message }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v3
with:
node-version: lts/*
cache: 'yarn'
- name: Install dependencies Node
run: yarn install --frozen-lockfile --non-interactive
- run: yarn build
- name: Release Node
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
- run: yarn copy:lua:python
- name: Setup Python
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4
with:
python-version: '3.10'
cache: 'pip'
- name: Install dependencies Python
run: |
python -m pip install --upgrade pip
pip install flake8 mypy types-redis
pip install -r python/requirements.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 ./python --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 ./python --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Release Python
if: ${{ contains(env.commitmsg, 'python') }}
run: |
cd python
pip install packaging
git config --global user.email "manast@taskforce.sh"
git config --global user.name "manast"
export VERSION=$(semantic-release print-version)
if [ ! -z "$VERSION" ]; then
GH_TOKEN=${{ secrets.GITHUB_TOKEN }} PYPI_TOKEN=${{ secrets.PYPI_TOKEN }} semantic-release publish
fi