Merge branch 'main' of github.com:basicmachines-co/basic-foundation #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release on Merge to Main | ||
on: | ||
push: | ||
branches: | ||
- main | ||
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 | ||
- name: Set up Git user | ||
run: | | ||
git config --local user.name "GitHub Action" | ||
git config --local user.email "[email protected]" | ||
# Bump the version (patch, minor, or major) | ||
- name: Bump Version | ||
id: bump_version | ||
run: | | ||
bump2version patch | ||
outputs: | ||
new_version: ${{ steps.bump_version.outputs.new_version }} | ||
# Push changes (committed by bump2version) | ||
- name: Push Version Bump Changes | ||
run: | | ||
git config user.name "github-actions[bot]" | ||
git config user.email "github-actions[bot]@users.noreply.github.com" | ||
git push origin main | ||
# 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${{ steps.bump_version.outputs.new_version }}' | ||
release_name: 'Release v${{ steps.bump_version.outputs.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 |