forked from ansible/django-ansible-base
-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (82 loc) · 2.4 KB
/
release.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
---
name: Release django-ansible-base
env:
LC_ALL: "C.UTF-8" # prevent ERROR: Ansible could not initialize the preferred locale: unsupported locale setting
on:
workflow_dispatch:
env:
PROJECT_NAME: django-ansible-base
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- name: Checkout dab
uses: actions/checkout@v4
with:
show-progress: false
- name: Get python version from Makefile
run: echo py_version=`make PYTHON_VERSION` >> $GITHUB_ENV
- name: Install python ${{ env.py_version }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.py_version }}
- name: Install python deps
run: pip install -r requirements/requirements_dev.txt
- name: Build the dists
run: >-
ansible-playbook
tools/ansible/release.yml
-i localhost
-e github_token=${{ secrets.GITHUB_TOKEN }}
-t build
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: |
dist/*.tar.gz
dist/*.whl
retention-days: 90
publish-pypi:
name: Publish to PyPI
needs:
- build
runs-on: ubuntu-latest
timeout-minutes: 1
environment:
name: pypi
url: https://pypi.org/project/${{ env.PROJECT_NAME }}
permissions:
contents: read # This job doesn't need to `git push` anything
id-token: write # PyPI Trusted Publishing (OIDC)
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish dists to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
post-release-repo-update:
name: Make a GitHub Release
needs:
- publish-pypi
runs-on: ubuntu-latest
timeout-minutes: 2
permissions:
packages: write
contents: write
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Create a GitHub Release uploading the dists
run: >-
ansible-playbook
tools/ansible/release.yml
-i localhost
-e github_token=${{ secrets.GITHUB_TOKEN }}
-t github