-
Notifications
You must be signed in to change notification settings - Fork 3
107 lines (92 loc) · 2.78 KB
/
release.yml
File metadata and controls
107 lines (92 loc) · 2.78 KB
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: release
on: [workflow_dispatch]
jobs:
release:
runs-on: ubuntu-latest
concurrency: release
environment:
name: pypi
url: https://pypi.org/p/codelimit
permissions:
id-token: write
contents: write
outputs:
version: ${{ steps.release.outputs.version }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Install dependencies
run: uv sync --locked --dev
- name: Python Semantic Release
id: release
uses: relekang/python-semantic-release@v9.21.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Update checkout
if: steps.release.outputs.released == 'true'
run: git pull
- name: Update lock file
if: steps.release.outputs.released == 'true'
run: uv lock
- name: Build distribution
if: steps.release.outputs.released == 'true'
run: uv build
- name: Publish to PyPI
if: steps.release.outputs.released == 'true'
uses: pypa/gh-action-pypi-publish@release/v1
- name: Commit changes
if: steps.release.outputs.released == 'true'
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Build by GitHub Actions
file_pattern: uv.lock
release_binaries:
name: Release binaries
needs: release
defaults:
run:
shell: bash
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macos-latest
TARGET: macos
CMD_BUILD: |
uv run pyinstaller \
-n codelimit -F codelimit/__main__.py
mv dist/codelimit dist/codelimit-macos
OUT_FILE_NAME: dist/codelimit-macos
- os: windows-latest
TARGET: windows
CMD_BUILD: |
uv run pyinstaller \
-n codelimit --onefile -c codelimit/__main__.py
OUT_FILE_NAME: dist/codelimit.exe
- os: ubuntu-22.04
TARGET: linux
CMD_BUILD: |
uv run pyinstaller \
-n codelimit -F codelimit/__main__.py
mv dist/codelimit dist/codelimit-linux
OUT_FILE_NAME: dist/codelimit-linux
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Install dependencies
run: uv sync --locked --dev
- name: Build codelimit with pyinstaller for ${{matrix.TARGET}}
run: ${{matrix.CMD_BUILD}}
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ format('v{0}', needs.release.outputs.version) }}
files: |
${{ matrix.OUT_FILE_NAME }}