-
Notifications
You must be signed in to change notification settings - Fork 15
67 lines (58 loc) · 1.86 KB
/
release-workflow.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
name: Python Package Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version Tag in the form X.Y.Z'
required: true
type: string
jobs:
build:
if: github.actor != 'github-actions[bot]'
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.APPLICATION_ID }}
private-key: ${{ secrets.APPLICATION_PRIVATE_KEY }}
- name: Checkout code
uses: actions/checkout@v4.2.2
with:
fetch-tags: true
fetch-depth: 0
ref: main
token: ${{ steps.app-token.outputs.token }} # Needed to trigger other actions
- name: Set up Python
uses: actions/setup-python@v5.3.0
with:
python-version: "3.9"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install hatch git-cliff
- name: Bump version and create
run: |
git tag ${{ inputs.version }}
git push origin ${{ inputs.version }}
- name: Update Changelog
run: |
hatch version ${{ inputs.version }}
git cliff -o CHANGELOG.md
- name: Commit and push changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "Update version and changelog"
git push --follow-tags
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
with:
tag_name: ${{ inputs.version }}
release_name: Release ${{ inputs.version }}
draft: false
prerelease: false