-
Notifications
You must be signed in to change notification settings - Fork 3
80 lines (68 loc) · 2.55 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
75
76
77
78
79
80
name: Test, Build, Package the Phase CLI
on:
pull_request:
push:
branches:
- main
release:
types: [created]
permissions:
contents: write
pull-requests: write
jobs:
# Run Tests
pytest:
uses: ./.github/workflows/pytest.yml
with:
python_version: '3.11'
# Fetch and validate version from source code
version:
uses: ./.github/workflows/version.yml
# Build and package the CLI using PyInstaller for Windows(amd64), Mac (Intel - amd64, Apple silicon arm64), Alpine linux (amd64), Linux (amd64, arm64) .deb, .rpm, binaries
# TODO: Add arm64 support for windows, arm64 packages (deb, rpm, apk)
build:
needs: [pytest, version]
uses: ./.github/workflows/build.yml
with:
python_version: '3.11'
version: ${{ needs.version.outputs.version }}
# Build docker image, push it to :latest and :<version> OS/Arch linux/amd64, linux/arm64, pull images, run the CLI and validate version
docker:
if: github.event_name == 'release' && github.event.action == 'created'
needs: [version]
uses: ./.github/workflows/docker.yml
with:
version: ${{ needs.version.outputs.version }}
secrets:
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }}
# Build, package and upload to pypi, install, run the cli and validate version
pypi:
if: github.event_name == 'release' && github.event.action == 'created'
needs: [version]
uses: ./.github/workflows/pypi.yml
with:
version: ${{ needs.version.outputs.version }}
secrets:
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
# Download packages, builds, binaries from build stage, rename, hash and zip the assets via the script
process-assets:
needs: [build, version]
uses: ./.github/workflows/process-assets.yml
with:
version: ${{ needs.version.outputs.version }}
# Download packaged assets zip and attach them to a release as assets
attach-to-release:
if: github.event_name == 'release' && github.event.action == 'created'
needs: [process-assets, version]
uses: ./.github/workflows/attach-to-release.yml
with:
version: ${{ needs.version.outputs.version }}
# Install, run and validate CLI version.
test-cli-install:
needs: [version, attach-to-release]
if: github.event_name != 'release' || (github.event_name == 'release' && github.event.action == 'created')
uses: ./.github/workflows/test-cli-install.yml
with:
version: ${{ needs.version.outputs.version }}