-
Notifications
You must be signed in to change notification settings - Fork 16
79 lines (75 loc) · 2.31 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Upload Python Package
permissions:
contents: write
on:
push:
tags:
- '*' # Push events to matching tags
workflow_dispatch:
env:
POETRY_VERSION: "1.8.3"
POETRY_URL: https://install.python-poetry.org
jobs:
release:
name: Create Release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate Changelog
run: .github/release_message.sh > release_message.md
- name: Release
uses: softprops/action-gh-release@v2
with:
body_path: release_message.md
deploy:
needs: release
strategy:
fail-fast: false
matrix:
python-version: [3.11]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
id: setup_python
- name: Cache Poetry cache
uses: actions/cache@v4
with:
path: ~/.cache/pypoetry
key: poetry-cache-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ env.POETRY_VERSION }}
- name: Cache Packages
uses: actions/cache@v4
with:
path: ~/.local
key: poetry-local-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}-${{ hashFiles('.github/workflows/*.yml') }}
- name: Install Poetry ${{ env.POETRY_VERSION }}
run: |
curl -sSL ${{ env.POETRY_URL }} | python - --version ${{ env.POETRY_VERSION }}
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install project
run: make install-extra
- name: Build and publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
make build
make publish
# - name: Log in to Docker Hub
# uses: docker/login-action@v3
# with:
# username: ${{ vars.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# - name: Build and push Docker image
# uses: docker/build-push-action@v4
# with:
# context: .
# push: true
# tags: testzeus/hercules:${{ github.ref_name }}