-
Notifications
You must be signed in to change notification settings - Fork 2
39 lines (39 loc) · 1.26 KB
/
release.yaml
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
name: pyautoenv release
on:
workflow_dispatch:
inputs:
version:
type: string
description: New version e.g., 3.1.4
required: true
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Validate Version
run: |
python -m pip install toml
poetry_version="$(python -c 'import toml; print(toml.load("pyproject.toml")["tool"]["poetry"]["version"])')"
echo "Version from input: ${{ github.event.inputs.version }}"
echo "Version from poetry: ${poetry_version}"
if ! [ "${{ github.event.inputs.version }}" = "${poetry_version}" ]; then
exit 1;
fi
script_version="$(python -c 'import pyautoenv; print(pyautoenv.__version__)')"
echo "Version from script: ${script_version}"
if ! [ "${poetry_version}" = "${script_version}" ]; then
exit 1;
fi
- name: Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "v${{ github.event.inputs.version }}" \
--target main \
--generate-notes \
--draft