-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (50 loc) · 2.12 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
name: Release
on:
push:
branches:
- master
jobs:
release:
runs-on: ubuntu-latest
env:
version:
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install dependencies
run: |
pip3 install --upgrade pip
pip3 install -r requirements.txt
- name: Get the current version
id: current-version
run: echo "version=$(python setup.py --version)" >> $GITHUB_ENV
- name: Check if the commit message matches the release pattern
run: |
if [[ $(git log -1 --pretty=%B) != "Release v${{ env.version }}" ]]; then
echo "Commit message does not match the release pattern."
exit 1
fi
- name: Setup PyPI Package using poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
poetry build
poetry config http-basic.pypi ${{ secrets.PYPI_USERNAME }} ${{ secrets.PYPI_PASSWORD }}
poetry publish
- name: Create a new release
uses: CupOfTea696/[email protected]
with:
title: "Release $version"
tag: "v$semver"
draft: false
regex: "/^Release #{semver}$/i"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload to GitHub Packages using Docker
run: |
docker build -t data-preprocessors .
docker login docker.pkg.github.com -u musfiqdehan -p ${{ secrets.PACKAGE_MANAGEMENT }}
docker tag data-preprocessors docker.pkg.github.com/musfiqdehan/data-preprocessors/data-preprocessors-image:v${{ env.version }}
docker push docker.pkg.github.com/musfiqdehan/data-preprocessors/data-preprocessors-image:v${{ env.version }}