-
Notifications
You must be signed in to change notification settings - Fork 52
75 lines (63 loc) · 2.08 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
63
64
65
66
67
68
69
70
71
72
73
74
75
name: release
on:
push:
branches: [ main ]
paths:
- "VERSION"
jobs:
build:
name: Build and publish new release
runs-on: "ubuntu-latest"
if: github.repository == 'drivendataorg/deon'
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11 with uv
uses: drivendataorg/setup-python-uv-action@v1
with:
python-version: 3.11
- name: Install dependencies
run: |
uv pip install -r dev-requirements.txt
- name: Build package
id: build_package
run: |
cat VERSION
echo "::set-output name=version::$(cat VERSION)"
make dist
- name: Publish to Test PyPI
uses: pypa/gh-action-pypi-publish@v1.3.0
with:
user: ${{ secrets.PYPI_TEST_USERNAME }}
password: ${{ secrets.PYPI_TEST_PASSWORD }}
repository_url: ${{ secrets.PYPI_TEST_REPOSITORY }}
skip_existing: true
- name: Publish to Production PyPI
uses: pypa/gh-action-pypi-publish@v1.3.0
with:
user: ${{ secrets.PYPI_PROD_USERNAME }}
password: ${{ secrets.PYPI_PROD_PASSWORD }}
repository_url: ${{ secrets.PYPI_PROD_REPOSITORY }}
skip_existing: false
- name: Tag commit
uses: tvdias/github-tagger@v0.0.1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
tag: v${{ steps.build_package.outputs.version }}
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.build_package.outputs.version }}
release_name: v${{ steps.build_package.outputs.version }}
draft: false
- name: Upload tarball to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/deon-${{ steps.build_package.outputs.version }}.tar.gz
asset_name: deon-${{ steps.build_package.outputs.version }}.tar.gz
asset_content_type: application/gzip