-
Notifications
You must be signed in to change notification settings - Fork 150
42 lines (39 loc) · 1.43 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
name: release
on:
workflow_dispatch:
inputs:
release:
description: 'tag to create and push, of the form "X.Y.Z"'
required: true
type: string
defaults:
run:
working-directory: python
jobs:
build-and-release:
# Since we only make pure python wheels and source,
# we only need to build on one platform.
runs-on: ubuntu-latest
permissions:
# Needed for trusted publishing to PyPI
id-token: write
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Install Hatch
run: pip install --upgrade hatch
- name: bump version, commit, tag, and push
run: |
echo "__version__ = \"${{ inputs.release }}\"" > src/nicknames/_version.py
git add src/nicknames/_version.py
git commit -m "Bump version to ${{ inputs.release }}"
git tag -a "v${{ inputs.release }}" -m "Release ${{ inputs.release }}"
git push
git push origin "v${{ inputs.release }}"
- name: Build sdist and wheel
run: hatch build
- name: Push build artifacts to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
packages-dir: python/dist