-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (65 loc) · 2.01 KB
/
semantic-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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Create new release
on:
push:
branches:
- main
jobs:
quality:
name: Run project test set
uses: ./.github/workflows/python-tests.yml
with:
target_workflow: ./.github/workflows/python-tests.yml
release:
needs: quality
runs-on: ubuntu-latest
concurrency: release
permissions:
id-token: write
contents: write
steps:
- name: Regex Match
uses: actions-ecosystem/[email protected]
id: regex
with:
text: ${{ github.event.head_commit.message }}
regex: '/^[0-9]+\.[0-9]+\.[0-9]+/.*'
- name: Deploy
if: steps.regex.outputs.matched == 'true'
run: |
echo "Foobar!"
- name: Not triggered by new release
if: ${{ ! startsWith(github.event.head_commit.message, '/^[0-9]+\.[0-9]+\.[0-9]+/' ) }}
run: |
echo "${{ github.event.head_commit.message }}"
echo "Bar"
- name: Triggered by new release
if: ${{ startsWith(github.event.head_commit.message, '/^[0-9]+\.[0-9]+\.[0-9]+/' ) }}
run: |
echo "${{ github.event.head_commit.message }}"
echo "Foo"
- name: Check Tag
id: check-tag
run: |
if [[ "${{ github.event.head_commit.message }}" =~ /[0-9]+\.[0-9]+\.[0-9]+/ ]]; then
echo "::set-output name=match::true"
fi
- name: Build
if: steps.check-tag.outputs.match == 'true'
run: |
echo "Tag is a match"
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.RELEASE_TOKEN }}
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.12
- name: Install Python dependencies
run:
pip install -r requirements.txt
- name: Python Semantic Release
uses: python-semantic-release/python-semantic-release@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}