-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (46 loc) · 1.38 KB
/
release-package.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
name: Release Website Package
on:
workflow_dispatch:
# push:
# branches:
# - main
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install Python dependencies
run: |
pip install -e ".[dev]"
# TODO: Add a better way to determine type of version change
- name: Determine Bump Type
id: bump_type
run: |
if [ "${{ github.event_name }}" == "push" ]; then
echo "bump_type=patch" >> $GITHUB_ENV
else
echo "bump_type=minor" >> $GITHUB_ENV
fi
- name: Launch bump version script
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
python release.py ${{ env.bump_type }}
PACKAGE_VERSION=$(sed -n 's/^version *= *"\(.*\)"/\1/p' pyproject.toml)
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
- name: Build Package
run: python -m build
- name: Create Release
uses: ncipollo/release-action@v1
with:
tag: v${{ env.PACKAGE_VERSION }}
artifacts: "dist/*.tar.gz"
bodyFile: CHANGELOG.md
token: ${{ secrets.GITHUB_TOKEN }}