BCF workflow now uses VERSION

This commit is contained in:
Dion Moult
2024-06-12 19:23:10 +10:00
parent d192217e78
commit 3c659a342f
4 changed files with 31 additions and 23 deletions
-16
View File
@@ -1,24 +1,8 @@
name: ci-bcf-pypi name: ci-bcf-pypi
on: on:
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# * * * * *
- cron: "0 0 18 * *"
push:
paths:
- '.github/workflows/ci-bcf-pypi.yml'
workflow_dispatch: workflow_dispatch:
env:
major: 0
minor: 0
name: ifcopenshell
jobs: jobs:
activate: activate:
runs-on: ubuntu-latest runs-on: ubuntu-latest
+25 -3
View File
@@ -1,4 +1,22 @@
VERSION:=`date '+%y%m%d'` # BCF - BCF Python library
# Copyright (C) 2021 Prabhat Singh <singh01prabhat@gmail.com>
#
# This file is part of BCF.
#
# BCF is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BCF is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with BCF. If not, see <http://www.gnu.org/licenses/>.
VERSION:=$(shell cat ../../VERSION)
SED:=sed -i SED:=sed -i
ifeq ($(UNAME_S),Darwin) ifeq ($(UNAME_S),Darwin)
SED:=sed -i '' -e SED:=sed -i '' -e
@@ -21,9 +39,13 @@ models:
.PHONY: dist .PHONY: dist
dist: dist:
rm -rf dist rm -rf dist
$(SED) "s/999999/$(VERSION)/" pyproject.toml cp pyproject.toml pyproject.toml.bak
cp src/bcf/__init__.py __init__.py.bak
$(SED) 's/version = "0.0.0"/version = "$(VERSION)"/' pyproject.toml
$(SED) 's/version = "0.0.0"/version = "$(VERSION)"/' src/bcf/__init__.py
python -m build python -m build
$(SED) "s/$(VERSION)/999999/" pyproject.toml mv pyproject.toml.bak pyproject.toml
mv __init__.py.bak src/bcf/__init__.py
# .PHONY # .PHONY
# api: # api:
+1 -1
View File
@@ -17,7 +17,7 @@ dependencies = [
"numpy", "numpy",
"ifcopenshell", "ifcopenshell",
] ]
version = "0.0.999999" version = "0.0.0"
classifiers = [ classifiers = [
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent", "Operating System :: OS Independent",
+2
View File
@@ -15,3 +15,5 @@
# #
# You should have received a copy of the GNU Lesser General Public License # You should have received a copy of the GNU Lesser General Public License
# along with BCF. If not, see <http://www.gnu.org/licenses/>. # along with BCF. If not, see <http://www.gnu.org/licenses/>.
__version__ = version = "0.0.0"