Skip to content

Commit 580ca0f

Browse files
feat: Added automatic-release.yml
1 parent 9dae7c3 commit 580ca0f

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: "auto-release"
2+
3+
on:
4+
push:
5+
branches:
6+
- "master"
7+
8+
jobs:
9+
pre-release:
10+
name: "Auto Release"
11+
runs-on: "ubuntu-latest"
12+
13+
steps:
14+
- uses: actions/checkout@master
15+
- name: Set up Python
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: '3.x'
19+
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install build setuptools wheel
24+
25+
- name: Build
26+
run: |
27+
python -m build
28+
pip install dist/*.whl
29+
echo "PACKAGE_VERSION=$(pip show pdf-helper | grep '^Version: ' | cut -d ' ' -f 2)" >> $GITHUB_ENV
30+
31+
- name: check-version
32+
uses: KyoriPowered/action-regex-match@v3
33+
id: check-version
34+
with:
35+
text: ${{ env.PACKAGE_VERSION }}
36+
regex: '\d+\.\d+\.\d+a\d+'
37+
38+
- uses: "marvinpinto/action-automatic-releases@latest"
39+
if: ${{ steps.check-version.outputs.match == '' }} # If didn't match
40+
with:
41+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
42+
automatic_release_tag: "${{ env.PACKAGE_VERSION }}"
43+
title: "Auto Build"
44+
files: |
45+
dist/*
46+

0 commit comments

Comments
 (0)