-
Notifications
You must be signed in to change notification settings - Fork 14
85 lines (72 loc) · 2.34 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
80
81
82
83
84
85
name: Release 🐍 distribution
on:
workflow_dispatch:
jobs:
github-release:
name: Create GitHub Release
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Install dependencies
run: |
uv sync
- name: Get version from __init__.py
id: get_version
run: |
version=$(uv run python -c "from src.parllama import __version__; print(__version__)")
echo "Raw version output: $version"
echo "VERSION=$version" >> $GITHUB_ENV
- name: Check version
id: check_version
run: |
echo "Version in env: ${{ env.VERSION }}"
if [ -z "${{ env.VERSION }}" ]; then
echo "Error: VERSION is empty"
exit 1
fi
- name: Restore cached build artifacts
uses: actions/cache@v4
with:
path: dist
key: ${{ runner.os }}-3.11-x64-${{ hashFiles('**/pyproject.toml') }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-3.11-x64-${{ hashFiles('**/pyproject.toml') }}-
${{ runner.os }}-3.11-x64-
- name: Sign the dists with Sigstore
uses: sigstore/[email protected]
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
gh release create \
'release-v${{ env.VERSION }}' \
--repo '${{ github.repository }}' \
--generate-notes \
--latest
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
gh release upload \
'release-v${{ env.VERSION }}' dist/** \
--repo '${{ github.repository }}'
- name: Discord notification
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@master
with:
args: 'A new release ${{ github.ref_name }} has been created for {{ EVENT_PAYLOAD.repository.full_name }}.'