-
Notifications
You must be signed in to change notification settings - Fork 4
51 lines (43 loc) · 1.58 KB
/
publish.yml
File metadata and controls
51 lines (43 loc) · 1.58 KB
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: Publish / Calculate Version
on: push
jobs:
build:
name: calculate version
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0 # This causes all history to be fetched, which is required for calculate-version to function
- name: Install Python 3.13
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: 3.13
- name: Install poetry
run: pip install poetry
- name: Cache poetry packages
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
id: cache
with:
path: ~/.venv
key: ${{ runner.os }}-utils-venv-${{ hashFiles('**/poetry.lock') }}
- name: Install
run: poetry install
if: steps.cache.outputs.cache-hit != 'true'
- name: Set SPEC_VERSION env var
run: |
version="$(poetry run python scripts/calculate_version.py)"
echo "${version}"
echo ::set-env name=SPEC_VERSION::${version}
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
- name: Create release (master only)
id: create-release
if: github.ref == 'refs/heads/master'
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1.1.4
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.SPEC_VERSION }}
release_name: ${{ env.SPEC_VERSION }}