Committing local a #17
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: | |
push: | |
branches: | |
- main # This means the action runs on every push to the 'main' branch | |
permissions: | |
contents: write | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Install bump2version | |
run: pip install bump2version | |
- name: Set up Git user | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
- name: Delete existing tag if it exists | |
run: | | |
TAG_NAME="v$(cat version.txt)" | |
if git rev-parse "$TAG_NAME" >/dev/null 2>&1; then | |
git push --delete origin "$TAG_NAME" | |
git tag -d "$TAG_NAME" | |
fi | |
- name: Bump version | |
run: bump2version minor --allow-dirty --tag | |
- name: Commit version bump | |
run: git commit -am "Bump version to $(cat version.txt)" | |
- name: Force push changes | |
uses: ad-m/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: main | |
force: true | |
- name: Push tags | |
run: git push origin --tags --force | |
- name: Create GitHub release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
dist/* # Path to any files you want to attach to the release (optional) | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |