-
-
Notifications
You must be signed in to change notification settings - Fork 239
42 lines (37 loc) · 1.15 KB
/
version_increment.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
name: CI
on:
push:
branches:
- master
jobs:
versioning:
runs-on: ubuntu-latest
permissions:
contents: write
actions: write
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Increment version
uses: saleweaver/version_increment_action@v1
with:
file_path: "sp_api/__version__.py"
version_key: "__version__"
- name: Create a new GitHub release
if: env.new_version != ''
uses: actions/create-release@v1
with:
tag_name: "v${{ env.new_version }}"
release_name: "v${{ env.new_version }}"
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Trigger release workflow
if: env.new_version != ''
run: |
curl -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/${{ github.repository }}/dispatches \
-d '{"event_type": "release_created", "client_payload": { "version": "${{ env.new_version }}" }}'