Repository navigation
78 lines (67 loc) · 2.46 KB
/
Copy pathrelease.yaml
File metadata and controls
78 lines (67 loc) · 2.46 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
---
"on":
pull_request:
push:
tags: ["**"]
name: Release
jobs:
docker:
runs-on: ubuntu-26.04
permissions:
contents: read
packages: write
timeout-minutes: 20
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@f211e3e9ded2d9377c8cadc4489a4e38014bc4c9
- name: Login to Github Packages
uses: docker/login-action@dd4fa0671be5250ee6f50aedf4cb05514abda2c7
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get docker metadata
id: meta
uses: docker/metadata-action@9be43f076db7f0f4ac30d81183fc9d956b9e9eb6
with:
images: ghcr.io/PiwikPRO/log-analytics
- name: Build image and push to GCR
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
with:
context: .
push: ${{ github.ref_type == 'tag' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
pypi:
runs-on: ubuntu-26.04
permissions:
contents: read
timeout-minutes: 20
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
architecture: x64
- name: Install uv
uses: astral-sh/setup-uv@eb1897b8dc4b5d5bfe39a428a8f2304605e0983c
with:
version: "latest"
python-version: "3.12"
enable-cache: true
cache-dependency-glob: |
pyproject.toml
uv.lock
- name: Update package version to current tag
if: ${{ github.ref_type == 'tag' }}
run: sed -i -e '/^version =/ s/= .*/= "${{ github.ref_name }}"/' pyproject.toml
- name: Build distributions
run: uv build
- name: Push the package to PyPI
if: ${{ github.ref_type == 'tag' }}
run: uv publish --token ${{ secrets.PYPI_TOKEN }}