-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (86 loc) · 2.87 KB
/
release.yaml
File metadata and controls
102 lines (86 loc) · 2.87 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
name: Release
on:
workflow_dispatch:
inputs:
tag:
description: Release Tag
required: true
default: dry-run
type: string
permissions:
contents: write
packages: write
actions: read
id-token: write
jobs:
# This will trigger the existing valk-server build but ensure we wait for it
trigger-server-build:
uses: ./.github/workflows/build-valk-server.yaml
secrets: inherit
with:
tag: ${{ inputs.tag }}
# This will run after server build
trigger-docker-build:
needs: trigger-server-build
uses: ./.github/workflows/build-chromium-demo.yaml
secrets: inherit
permissions:
contents: write
packages: write # For pushing to container registry
actions: read # For downloading artifacts
with:
tag: ${{ inputs.tag }}
python-lint:
uses: ./.github/workflows/python-lint.yaml
secrets: inherit
# This will run after docker build - (python integration tests require updated docker image)
integration-tests:
needs: [trigger-docker-build, python-lint]
uses: ./.github/workflows/python-integration-tests.yaml
secrets: inherit
# Make sure the version in pyproject.toml matches the tag
check-pyproject-version:
if: inputs.tag != 'dry-run'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install the latest version of uv and set the python version
uses: astral-sh/setup-uv@v5
- name: Check version matches tag (pyproject.toml)
run: |
VERSION=$(grep '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/')
TAG="${{ inputs.tag }}"
TAG="${TAG#v}" # Remove v prefix if present
if [ "$VERSION" != "$TAG" ]; then
echo "Version mismatch: pyproject.toml has $VERSION but tag is ${{ inputs.tag }}"
exit 1
fi
# Final publish job that creates the release
publish:
needs: [integration-tests, check-pyproject-version]
runs-on: ubuntu-latest
environment: release
if: inputs.tag != 'dry-run'
steps:
- name: Install the latest version of uv and set the python version
uses: astral-sh/setup-uv@v5
- uses: actions/checkout@v4
- name: Build wheel
run: |
uv build --wheel
- name: Upload wheel artifact
uses: actions/upload-artifact@v4
with:
name: python-dist-${{ inputs.tag }}
path: dist/*
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Upload to Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ inputs.tag }}
files: artifacts/**/*
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1