This repository has been archived by the owner on Nov 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
53 lines (42 loc) · 1.51 KB
/
publish.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
name: Publish
on:
release:
types: [published]
jobs:
publish-pypi:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install twine jinja2
- id: pkg_version
run: echo "##[set-output name=data;]$(echo ${{ github.event.release.tag_name }} | cut -c2-)"
- name: Build Python package
run: |
python -c 'import jinja2;jinja2.Template(open("setup.j2").read()).stream(version="${{ steps.pkg_version.outputs.data }}").dump("setup.py")'
python setup.py sdist bdist_wheel
- name: Twine check
run: |
twine check dist/*
- name: Upload to PyPI
run: |
twine upload dist/* -u ${{ secrets.PYPI_LOGIN }} -p ${{ secrets.PYPI_PASSWORD }}
publish-dockerhub:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Build the Docker image
run: |
docker build . --file Dockerfile -t dnstap-receiver
- name: Tag image
run: |
docker tag dnstap-receiver dmachard/dnstap-receiver:${{ github.event.release.tag_name }}
docker tag dnstap-receiver dmachard/dnstap-receiver:latest
- name: Upload to DockerHub
run: |
docker login -u ${{ secrets.DOCKERHUB_LOGIN }} -p ${{ secrets.DOCKERHUB_PASSWORD }}
docker push dmachard/dnstap-receiver:latest
docker push dmachard/dnstap-receiver:${{ github.event.release.tag_name }}