-
Notifications
You must be signed in to change notification settings - Fork 142
51 lines (43 loc) · 1.47 KB
/
release.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
name: Create Release
on:
push:
branches: ["master"]
jobs:
release:
runs-on: ubuntu-latest
# Only run this job if we're not already creating a release
if: "!contains(github.event.head_commit.message, 'chore(release):')"
permissions:
contents: write # Needed for creating tags and releases
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }} # Using built-in token with explicitly granted permissions
- uses: actions/setup-python@v5
with:
python-version: '3.8'
architecture: 'x64'
- name: Install Poetry and dependencies
run: |
pip install poetry
poetry install
- name: Get Version
id: get_version
run: |
VERSION=$(poetry run ./current_version.py)
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Create Tag
run: |
git tag v${{ steps.get_version.outputs.version }}
git push origin v${{ steps.get_version.outputs.version }}
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ steps.get_version.outputs.version }}
name: Release v${{ steps.get_version.outputs.version }}
draft: false
prerelease: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}