-
Notifications
You must be signed in to change notification settings - Fork 1
executable file
·55 lines (53 loc) · 1.88 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
name: release
on:
workflow_dispatch:
inputs:
version:
description: "Release version"
required: true
type: string
jobs:
release:
runs-on: ubuntu-latest
env:
VERSION: ${{ github.event.inputs.version }}
BRANCH: releases/${{ github.event.inputs.version }}
steps:
- uses: actions/checkout@v3
with:
ref: releases/${{ github.event.inputs.version }}
ssh-key: ${{ secrets.USER_SSH_KEY }}
fetch-depth: 0
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Set up Git
run: |
echo "${{ secrets.USER_GPG_KEY }}" | gpg --import
git config --add user.name "${{ secrets.USER_NAME }}"
git config --add user.email "${{ secrets.USER_MAIL }}"
git config --add user.signingkey "${{ secrets.USER_GPG_ID }}"
git config commit.gpgsign true
- name: Run build
run: |
pip install --upgrade hatch
hatch version ${{ env.VERSION }}
hatch --verbose build
- name: Merge release branch
run: |
git commit -am "Release ${{ env.VERSION }}: increment version"
git checkout main
git merge --no-ff ${{ env.BRANCH }}
git tag -a v${{ env.VERSION }} -m "Release ${{ env.VERSION }}"
# Try to merge back release branch
git checkout ${{ env.BRANCH }}
git merge --ff-only main
git checkout develop
git merge --no-ff ${{ env.BRANCH }}
git push --atomic origin main develop refs/tags/v${{ env.VERSION }} :${{ env.BRANCH }}
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}
verbose: true