-
Notifications
You must be signed in to change notification settings - Fork 2
62 lines (53 loc) · 1.69 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
name: Release
permissions:
contents: write
on:
workflow_dispatch:
inputs:
target:
required: true
type: choice
options:
- "TestPyPi"
- "PyPi"
default: "TestPyPi"
jobs:
release:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Setup environment
run: |
python3 -m pip install poetry
make venv
make bison BISON_INSTALL_PATH=/tmp/bison-install
echo "/tmp/bison-install/bin" >> ${GITHUB_PATH}
- name: Create package
run: make package
- name: Publish package (test.pypi.org)
if: github.event.inputs.target== 'TestPyPi'
run: |
poetry config repositories.test-pypi https://test.pypi.org/legacy/
poetry config pypi-token.test-pypi ${{ secrets.TEST_PYPI_API_TOKEN }}
poetry publish -r test-pypi
- name: Publish package (pypi.org)
if: github.event.inputs.target== 'PyPi'
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}
poetry publish
- name: Publish GitHub Release
if: github.event.inputs.target== 'PyPi'
run: |
VERSION=$(poetry version -s)
TITLE="${VERSION}"
DESCRIPTION="Generated for [AxoSyslog $(make print-axosyslog-version)]($(make print-axosyslog-release-url))."
TAG="${VERSION}"
TARBALL="dist/axosyslog_cfg_helper-${VERSION}.tar.gz"
gh release create \
--title "${TITLE}" \
--notes "${DESCRIPTION}" \
"${TAG}" \
"${TARBALL}"