Skip to content

Commit db2543e

Browse files
fix: update workflow
1 parent a13889b commit db2543e

3 files changed

Lines changed: 65 additions & 63 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Prepare Release PR
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
create_release_pr:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
- run: |
17+
git checkout -b release-main
18+
git push origin release-main --force
19+
- uses: peter-evans/create-pull-request@v5
20+
with:
21+
base: main
22+
head: release-main
23+
title: "Automated Release PR: release-main -> main"
24+
body: "Automated release changes."
25+
branch: pr-release-main-to-main
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Release and Publish Package
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
release:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
- name: Set up Python
17+
uses: actions/setup-python@v3
18+
with:
19+
python-version: "3.x"
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install build twine semantic-release setuptools-scm
24+
- name: Run semantic-release
25+
env:
26+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
run: |
28+
git config user.name github-actions
29+
git config user.email github-actions@github-actions.github.com
30+
semantic-release version
31+
semantic-release publish
32+
- name: Build package
33+
run: python -m build
34+
- name: Publish package to PyPI
35+
env:
36+
TWINE_USERNAME: __token__
37+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
38+
run: twine upload dist/*
39+
- name: Delete release-main branch from remote
40+
run: git push origin --delete release-main

.github/workflows/workflow.yml

Lines changed: 0 additions & 63 deletions
This file was deleted.

0 commit comments

Comments
 (0)