-
-
Notifications
You must be signed in to change notification settings - Fork 1
74 lines (71 loc) · 2.08 KB
/
main.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
name: Lint and Compile
on:
release:
types:
- created
push:
pull_request:
permissions:
# ghcr.io
packages: write
jobs:
lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
python-version: 3.12
- run: pip install .[dev]
- run: python -m ruff check --output-format=github .
build:
runs-on: ubuntu-22.04
needs:
- lint
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
python-version: 3.12
- uses: justalemon/[email protected]
with:
version: 0.0.1-alpha.${{ github.run_number }}
pyproject-files: "pyproject.toml"
initpy-files: "leek/__init__.py"
- run: pip install .[dev]
- run: python -m build
- uses: actions/[email protected]
with:
name: ${{ github.event.repository.name }}
path: dist/*
docker:
runs-on: ubuntu-22.04
needs:
- build
steps:
- uses: actions/[email protected]
- uses: justalemon/[email protected]
with:
version: 0.0.1-alpha.${{ github.run_number }}
pyproject-files: "pyproject.toml"
initpy-files: "leek/__init__.py"
- uses: docker/[email protected]
- uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- uses: docker/[email protected]
id: meta
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha,format=short,prefix=
type=raw,value=latest,enable={{ is_default_branch }}
- uses: docker/[email protected]
if: ${{ format('refs/heads/{0}', github.event.repository.default_branch) == github.ref || startsWith(github.ref, 'refs/tags/') }}
with:
push: true
tags: ${{ steps.meta.outputs.tags }}