-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (49 loc) · 1.49 KB
/
release.yml
File metadata and controls
58 lines (49 loc) · 1.49 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
name: Release
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run tests
working-directory: systemzero
run: |
python -m pytest tests/ -v --tb=short --cov=systemzero --cov-report=xml
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push image
env:
GITHUB_REF_NAME: ${{ github.ref_name }}
run: |
OWNER=$(echo "${GITHUB_REPOSITORY_OWNER}" | tr '[:upper:]' '[:lower:]')
IMAGE="ghcr.io/${OWNER}/systemzero"
docker build -t ${IMAGE}:${GITHUB_REF_NAME} -t ${IMAGE}:latest .
docker push ${IMAGE}:${GITHUB_REF_NAME}
docker push ${IMAGE}:latest
- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: coverage-xml
path: systemzero/coverage.xml
- name: Create Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: |
systemzero/coverage.xml