-
Notifications
You must be signed in to change notification settings - Fork 10
58 lines (55 loc) · 1.81 KB
/
publish.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
57
58
name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'SemVer format release tag, i.e. 0.23.4'
required: true
jobs:
bump-version:
name: Bump Version and Release
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
permissions: write-all
# IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python_version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}
- uses: Gr1N/setup-poetry@v8
- name: Install poetry dependencies
run: poetry install
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
- name: Update Doltcli version
run: |
sed -i 's/^version = \S*/version = "'"$VERSION"'"/' "$FILE"
env:
FILE: pyproject.toml
VERSION: ${{ github.event.inputs.version }}
- uses: EndBug/add-and-commit@v7
with:
message: ${{ format('[ga-bump-release] update Doltcli version to {0}', github.event.inputs.version) }}
add: ${{ format('{0}/pyproject.toml', github.workspace) }}
cwd: "."
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ github.event.inputs.version }}
release_name: ${{ github.event.inputs.version }}
draft: false
prerelease: false
- name: Build
run: |
poetry build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
env:
PASSWORD: ${{ secrets.pypi_password }}
USERNAME: Dolthub