-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (37 loc) · 1.09 KB
/
releases.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
name: Release on Version Change
on:
push:
paths:
- 'pyproject.toml'
branches:
- main
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Get version number
id: get_version
run: |
VERSION=$(grep '^version =' pyproject.toml | sed 's/version = "//g' | sed 's/"//g')
echo "VERSION=$VERSION" > $GITHUB_ENV
- name: Create Git tag
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git tag "code-assistant${{ env.VERSION }}"
git push origin "code-assistant${{ env.VERSION }}"
- name: Create GitHub Release
uses: actions/create-release@v1
with:
tag_name: "${{ env.VERSION }}"
release_name: "v${{ env.VERSION }}"
body: "Automated release for v${{ env.VERSION }}"
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}