-
Notifications
You must be signed in to change notification settings - Fork 43
88 lines (72 loc) · 2.82 KB
/
v0.6.0_install-and-publish-packages.yaml
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
name: Install and Publish Specified Packages (Package Manager)
on:
workflow_dispatch:
inputs:
tag_name:
description: "The base tag for the release (e.g., v0.6.0)"
required: true
pre_release:
description: "The pre-release identifier (e.g., .dev1, .rc1, .alpha1)"
required: false
default: ""
jobs:
test:
env:
UNIQUE_VENV_PATH: "${{ github.workspace }}/.venv_core_${{ github.run_id }}"
runs-on: self-hosted
steps:
- name: Check Out Repository
uses: actions/checkout@v4
- name: Set Up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Extract Version from Tag
id: extract-version
run: |
FULL_TAG="${{ inputs.tag_name }}${{ inputs.pre_release }}"
echo "Full tag: $FULL_TAG"
# Remove the 'v' prefix if present and extract the version
VERSION=${FULL_TAG#v}
echo "Extracted version: $VERSION"
echo "version=$VERSION" >> $GITHUB_ENV
- name: Create and Activate Virtual Environment
run: |
python -m venv $UNIQUE_VENV_PATH
source $UNIQUE_VENV_PATH/bin/activate
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "PATH=$HOME/.local/bin:$PATH" >> $GITHUB_ENV
- name: Install toml
run: |
source $UNIQUE_VENV_PATH/bin/activate
pip install toml
- name: Set Version in pyproject.toml
run: |
source $UNIQUE_VENV_PATH/bin/activate
python scripts/manage_packages.py set-version --directory pkgs --version ${{ env.version }}
- name: Set Dependency Versions in pyproject.toml
run: |
source $UNIQUE_VENV_PATH/bin/activate
python scripts/manage_packages.py set-dependency-versions --directory pkgs --version ${{ env.version }}
- name: Generate poetry.lock
run: |
source $UNIQUE_VENV_PATH/bin/activate
python scripts/manage_packages.py poetry-lock --directory pkgs
- name: Install Dependencies
run: |
source $UNIQUE_VENV_PATH/bin/activate
python scripts/manage_packages.py poetry-install --directory pkgs --all-extras --dev
- name: Publish from Dependencies
run: |
source $UNIQUE_VENV_PATH/bin/activate
python scripts/manage_packages.py publish-from-dependencies --directory pkgs --username __token__ --password secret_password
- name: Show Installed Packages
run: |
source $UNIQUE_VENV_PATH/bin/activate
python scripts/manage_packages.py show-pip-freeze
- name: Clean Up Virtual Environment
if: always()
run: |
rm -rf ${{ env.UNIQUE_VENV_PATH }}