-
Notifications
You must be signed in to change notification settings - Fork 11
93 lines (79 loc) · 2.18 KB
/
test-build-release.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
89
90
91
92
93
---
name: Test and Release
on:
push:
branches:
- '**'
tags-ignore:
- '**'
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Run tests
shell: bash
run: |
set -euo pipefail
./test-in-docker.sh
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Get next version
uses: reecetech/[email protected]
id: version
with:
scheme: semver
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.10' # Should match Pipfile / "python_version"
- name: Build package
shell: bash
run: |
set -euo pipefail
VERSION="${{ steps.version.outputs.version }}"
echo "VERSION = '${VERSION}'" > django_informixdb/version.py
pip install "setuptools>=62.2.0"
python3 setup.py sdist
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist/
retention-days: 3
release:
if: ${{ github.ref == 'refs/heads/master' }}
needs:
- test
- build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Get next version
uses: reecetech/[email protected]
id: version
with:
scheme: semver
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: dist # the name of the artefact from the `build` step
path: dist/
- name: Release version on GitHub
uses: marvinpinto/action-automatic-releases@919008cf3f741b179569b7a6fb4d8860689ab7f0
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
draft: false
prerelease: false
automatic_release_tag: "${{ steps.version.outputs.version }}"
- name: Release version on PyPi
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
print_hash: true
# vim: set sw=2: