-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (44 loc) · 1.84 KB
/
release.yml
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
name: "Release"
on:
workflow_dispatch:
jobs:
release:
name: Create release tag
runs-on: ubuntu-latest
steps:
- name: Checkout repository (full-depth)
uses: actions/checkout@v4
with: { fetch-depth: 0 } # Required to determine version
- name: Get next release version
uses: dronetag/actions/semantic-release@main
id: semantic
- name: Build package
uses: dronetag/actions/build-python@main
with:
version: ${{ steps.semantic.outputs.version }}
- name: Commit version on release branch
if: ${{ steps.semantic.outputs.existed == 'false' }}
run: |
if [[ $(git rev-parse origin/${{github.event.repository.default_branch}}) = $(git rev-parse HEAD) ]]; then
git checkout ${{github.event.repository.default_branch}} # in case we are on tag
if [[ ! $(git diff --exit-code) ]]; then
git config --local user.email "" && git config --local user.name "GitHub Action"
git diff --name-only | xargs git add
git add changelog.md
git commit -m "Release ${{ steps.semantic.outputs.version }} [skip ci]"
git push origin ${{github.event.repository.default_branch}}
fi
fi
- name: Create the tag (if it does not exist yet)
run: |
git show-ref --tags --verify --quiet "refs/tags/v${{ steps.semantic.outputs.version }}" && exit 0
git config --local user.email "" && git config --local user.name "GitHub Action"
git tag v${{ steps.semantic.outputs.version }}
git push origin v${{ steps.semantic.outputs.version }}
- name: Release
uses: dronetag/actions/release-python@main
with:
pypi_name: dronetag
pypi_host: ${{ secrets.PRIV_PIP_HOST }}
pypi_user: ${{ secrets.PRIV_PIP_USER }}
pypi_pass: ${{ secrets.PRIV_PIP_PASSWORD }}