generated from sirmrak/ha-integration-template
@@ -0,0 +1,41 @@
|
||||
name: Create Dev Branch
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
workflow_dispatch: # Позволяет запустить вручную
|
||||
|
||||
jobs:
|
||||
create-dev:
|
||||
name: Create Dev Branch
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.PAT_TOKEN }}
|
||||
|
||||
- name: Check if dev branch exists
|
||||
id: check_branch
|
||||
run: |
|
||||
if git ls-remote --heads origin dev | grep -q "refs/heads/dev"; then
|
||||
echo "dev_exists=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "dev_exists=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Create dev branch
|
||||
if: steps.check_branch.outputs.dev_exists == 'false'
|
||||
run: |
|
||||
git config --local user.email "actions@gitea.local"
|
||||
git config --local user.name "Gitea Actions Bot"
|
||||
|
||||
git checkout -b dev
|
||||
git push origin dev
|
||||
echo "Dev branch created successfully"
|
||||
@@ -0,0 +1,45 @@
|
||||
name: Update Version
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
- dev
|
||||
|
||||
jobs:
|
||||
update-version:
|
||||
name: Update Version
|
||||
runs-on: ubuntu-latest
|
||||
if: github.actor != 'gitea-actions[bot]' && github.actor != 'Gitea Actions Bot'
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.PAT_TOKEN }}
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.11"
|
||||
|
||||
- name: Install dependencies
|
||||
run: pip install python-semantic-release
|
||||
|
||||
- name: Configure Git
|
||||
run: |
|
||||
git config --local user.email "actions@gitea.local"
|
||||
git config --local user.name "Gitea Actions Bot"
|
||||
|
||||
- name: Run semantic-release
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.PAT_TOKEN }}
|
||||
run: |
|
||||
unset GITHUB_SERVER_URL
|
||||
unset GITHUB_API_URL
|
||||
unset GITHUB_REPOSITORY
|
||||
semantic-release version
|
||||
Reference in New Issue
Block a user