-
Notifications
You must be signed in to change notification settings - Fork 4
95 lines (84 loc) · 3.09 KB
/
Copy pathdeploy.yml
File metadata and controls
95 lines (84 loc) · 3.09 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
name: Deploy Release
on:
workflow_dispatch:
release:
types: [published]
env:
# Force JS actions to run under Node 24; the v4/v5 majors of the
# actions/* family still ship Node 20 entrypoints as of mid-2026.
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
tag-release:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_version.outputs.version }}
tag: ${{ steps.get_version.outputs.tag }}
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Extract version from pyproject.toml
id: get_version
run: |
VERSION=$(python -c "
try:
import tomllib
with open('pyproject.toml', 'rb') as f:
data = tomllib.load(f)
print(data['project']['version'])
except Exception as e:
import sys
print(f'Error reading version: {e}', file=sys.stderr)
exit(1)
")
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "tag=v$VERSION" >> $GITHUB_OUTPUT
- name: Check if tag exists
id: check_tag
run: |
if git ls-remote --tags origin | grep -q "refs/tags/v${{ steps.get_version.outputs.version }}"; then
echo "Tag already exists"
echo "exists=true" >> $GITHUB_OUTPUT
else
echo "Tag does not exist"
echo "exists=false" >> $GITHUB_OUTPUT
fi
- name: Tag the release
if: steps.check_tag.outputs.exists == 'false'
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git tag v${{ steps.get_version.outputs.version }}
git push origin v${{ steps.get_version.outputs.version }}
deploy-pypi:
needs: tag-release
uses: ./.github/workflows/deploy-pypi.yml
secrets:
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
deploy-dockerhub:
needs: deploy-pypi
uses: ./.github/workflows/deploy-dockerhub.yml
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
deploy-launcher:
needs: deploy-dockerhub
uses: ./.github/workflows/deploy-launcher.yml
secrets:
MACOS_CERT_P12_BASE64: ${{ secrets.MACOS_CERT_P12_BASE64 }}
MACOS_CERT_PASSWORD: ${{ secrets.MACOS_CERT_PASSWORD }}
MACOS_KEYCHAIN_PASSWORD: ${{ secrets.MACOS_KEYCHAIN_PASSWORD }}
APPLE_API_KEY_P8_BASE64: ${{ secrets.APPLE_API_KEY_P8_BASE64 }}
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
APPLE_API_ISSUER_ID: ${{ secrets.APPLE_API_ISSUER_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
upload-release:
needs: [tag-release, deploy-pypi, deploy-dockerhub, deploy-launcher]
uses: ./.github/workflows/upload-artifacts.yml
with:
tag_name: ${{ needs.tag-release.outputs.tag }}