-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (51 loc) · 1.58 KB
/
release.yml
File metadata and controls
61 lines (51 loc) · 1.58 KB
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
name: Release on Merge to Main
#
on:
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout code
- uses: actions/checkout@v4
# Step 2: Set up Python
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12.1"
# Step 3: Install dependencies (including bump2version)
- name: Install Dependencies
run: |
pip install poetry
poetry install
pip install bump2version
# Step 4: Set up Git user
- name: Set up Git user
run: |
git config --local user.name "GitHub Action"
git config --local user.email "action@github.com"
# Step 5: Bump the version (patch, minor, or major)
- name: Bump Version
run: |
bump2version patch
git push origin main
# Step 6: Extract new version from version.txt
- name: Get New Version
id: get_version
run: echo "NEW_VERSION=$(cat version.txt)" >> $GITHUB_ENV
# Step 7: Create a GitHub Release
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: 'v${{ env.NEW_VERSION }}'
release_name: 'Release v${{ env.NEW_VERSION }}'
draft: false
prerelease: false
# - name: Upload Build Artifacts
# uses: actions/upload-artifact@v4
# with:
# name: basic-foundation-build
# path: dist/ # Path to your build artifacts