Skip to content

Commit

Permalink
Remove VERSION and add install script and release action
Browse files Browse the repository at this point in the history
Signed-off-by: Erik Jaegervall <[email protected]>
  • Loading branch information
erikbosch committed Sep 19, 2024
1 parent a6e7bef commit 1f4fa48
Show file tree
Hide file tree
Showing 5 changed files with 140 additions and 30 deletions.
41 changes: 34 additions & 7 deletions .github/workflows/buildcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ on:
push:
pull_request:
workflow_dispatch:
inputs:
vss-version:
required: false
type: string
workflow_call:
inputs:
vss-version:
required: false
type: string

jobs:
buildtest:
Expand All @@ -20,20 +29,38 @@ jobs:
python -V
python -m pip --quiet --no-input install --upgrade pip
python -m pip --quiet --no-input install --upgrade wheel
pip install pytest
# idlc currently used both during python test and later in this script
pip install cyclonedds
pip install git+https://github.com/COVESA/vss-tools@master
sudo apt install -y protobuf-compiler
./scripts/install_vss_tools.sh
echo done!
- name: Test mandatory targets
run: |
if "${{ inputs.vss-version }}" != ""; then
export VSS_VERSION="${{ inputs.vss-version }}"
fi
make mandatory_targets
- name: "Uploading artifacts"
uses: actions/upload-artifact@v4
with:
name: vss-artifacts
# Listing all artifacts that shall be managed as release artifacts
path: |
vss.csv
vss.fidl
vss.grapql.ts
vss.idl
vss.json
vss.jsonschema
vss.yaml
vss_noexpand.json
vss_samm.tar.gz
vss_apigear.tar.gz
if-no-files-found: error

- name: Test that ddsidl is correct
run: |
idlc vss_rel_*.idl
pip install cyclonedds
idlc vss*.idl
- name: Prepare for CSV check
Expand All @@ -46,7 +73,7 @@ jobs:
run: |
# Install csvlint to check compliance with https://datatracker.ietf.org/doc/html/rfc4180
go install github.com/Clever/csvlint/cmd/csvlint@latest
csvlint vss_rel_*.csv
csvlint vss*.csv
- name: Test optional targets. NOTE - always succeeds
run: |
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/create_draft_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Create Draft Release

on:
workflow_dispatch: # input version manually. Overrides push tag
inputs:
vss-version:
description: "Release version (numerical version), e.g. 4.2, 4.2rc0"
required: true
default: "0.0.0"

# Needed if GITHUB_TOKEN by default do not have right to create release
permissions:
contents: write
packages: write

jobs:
call_kuksa_databroker_build:
uses: ./.github/workflows/buildcheck.yml
with:
vss-version: ${{ inputs.vss-version }}

create_release:
runs-on: ubuntu-latest
needs:
[
call_kuksa_databroker_build
]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: build-artifacts
merge-multiple: true
- name: Display structure of downloaded files
run: |
ls -R build-artifacts
- name: Create release
id: create_release
uses: softprops/action-gh-release@v2
with:
draft: true
tag_name: "v${{ inputs.vss-version }}"
fail_on_unmatched_files: true
files: |
build-artifacts/*
spec/units.yaml
spec/quantities.yaml
42 changes: 20 additions & 22 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,67 +16,65 @@ mandatory_targets: clean json json-noexpand franca yaml binary csv graphql ddsid
# from time to time
# Can be run from e.g. travis with "make -k optional_targets || true" to continue
# even if errors occur and not do not halt travis build if errors occur
optional_targets: clean protobuf ttl binary
optional_targets: clean protobuf ttl

TOOLSDIR?=./vss-tools
VSS_VERSION ?= 0.0
COMMON_ARGS=-u ./spec/units.yaml --strict
COMMON_VSPEC_ARG=-s ./spec/VehicleSignalSpecification.vspec

json:
vspec export json ${COMMON_ARGS} ${COMMON_VSPEC_ARG} -o vss_rel_$$(cat VERSION).json
vspec export json ${COMMON_ARGS} ${COMMON_VSPEC_ARG} -o vss.json

json-noexpand:
vspec export json ${COMMON_ARGS} --no-expand ${COMMON_VSPEC_ARG} -o vss_rel_$$(cat VERSION)_noexpand.json
vspec export json ${COMMON_ARGS} --no-expand ${COMMON_VSPEC_ARG} -o vss_noexpand.json

jsonschema:
vspec export jsonschema ${COMMON_ARGS} ${COMMON_VSPEC_ARG} -o vss_rel_$$(cat VERSION).jsonschema
vspec export jsonschema ${COMMON_ARGS} ${COMMON_VSPEC_ARG} -o vss.jsonschema

franca:
vspec export franca --franca-vss-version $$(cat VERSION) ${COMMON_ARGS} ${COMMON_VSPEC_ARG} -o vss_rel_$$(cat VERSION).fidl
vspec export franca --franca-vss-version $(VSS_VERSION) ${COMMON_ARGS} ${COMMON_VSPEC_ARG} -o vss.fidl

yaml:
vspec export yaml ${COMMON_ARGS} ${COMMON_VSPEC_ARG} -o vss_rel_$$(cat VERSION).yaml
vspec export yaml ${COMMON_ARGS} ${COMMON_VSPEC_ARG} -o vss.yaml

csv:
vspec export csv ${COMMON_ARGS} ${COMMON_VSPEC_ARG} -o vss_rel_$$(cat VERSION).csv
vspec export csv ${COMMON_ARGS} ${COMMON_VSPEC_ARG} -o vss.csv

ddsidl:
vspec export ddsidl ${COMMON_ARGS} ${COMMON_VSPEC_ARG} -o vss_rel_$$(cat VERSION).idl
vspec export ddsidl ${COMMON_ARGS} ${COMMON_VSPEC_ARG} -o vss.idl

# Verifies that supported overlay combinations are syntactically correct.
overlays:
vspec export json ${COMMON_ARGS} -l overlays/profiles/motorbike.vspec ${COMMON_VSPEC_ARG} -o vss_rel_$$(cat VERSION)_motorbike.json
vspec export json ${COMMON_ARGS} -l overlays/extensions/dual_wiper_systems.vspec ${COMMON_VSPEC_ARG} -o vss_rel_$$(cat VERSION)_dualwiper.json
vspec export json ${COMMON_ARGS} -l overlays/extensions/OBD.vspec ${COMMON_VSPEC_ARG} -o vss_rel_$$(cat VERSION)_obd.json

tests:
PYTHONPATH=${TOOLSDIR} pytest
vspec export json ${COMMON_ARGS} -l overlays/profiles/motorbike.vspec ${COMMON_VSPEC_ARG} -o vss_motorbike.json
vspec export json ${COMMON_ARGS} -l overlays/extensions/dual_wiper_systems.vspec ${COMMON_VSPEC_ARG} -o vss_dualwiper.json
vspec export json ${COMMON_ARGS} -l overlays/extensions/OBD.vspec ${COMMON_VSPEC_ARG} -o vss_obd.json

binary:
vspec export binary ${COMMON_ARGS} ${COMMON_VSPEC_ARG} -o vss_rel_$$(cat VERSION).binary
vspec export binary ${COMMON_ARGS} ${COMMON_VSPEC_ARG} -o vss.binary

protobuf:
vspec export protobuf ${COMMON_ARGS} ${COMMON_VSPEC_ARG} -o vss_rel_$$(cat VERSION).proto
vspec export protobuf ${COMMON_ARGS} ${COMMON_VSPEC_ARG} -o vss.proto

graphql:
vspec export graphql ${COMMON_ARGS} ${COMMON_VSPEC_ARG} -o vss_rel_$$(cat VERSION).graphql.ts
vspec export graphql ${COMMON_ARGS} ${COMMON_VSPEC_ARG} -o vss.graphql.ts

apigear:
vspec export apigear ${COMMON_ARGS} ${COMMON_VSPEC_ARG} --output-dir apigear
cd apigear && tar -czvf ../vss_rel_$$(cat ../VERSION)_apigear.tar.gz * && cd ..
cd apigear && tar -czvf ../vss_apigear.tar.gz * && cd ..

samm:
vspec export samm ${COMMON_ARGS} ${COMMON_VSPEC_ARG} --target-folder samm
cd samm && tar -czvf ../vss_rel_$$(cat ../VERSION)_samm.tar.gz * && cd ..
cd samm && tar -czvf ../vss_samm.tar.gz * && cd ..

# vspec2ttl does not use common generator framework
ttl:
${TOOLSDIR}/contrib/vspec2ttl/vspec2ttl.py -u ./spec/units.yaml ./spec/VehicleSignalSpecification.vspec vss_rel_$$(cat VERSION).ttl
${TOOLSDIR}/contrib/vspec2ttl/vspec2ttl.py -u ./spec/units.yaml ./spec/VehicleSignalSpecification.vspec vss.ttl

id:
vspec export id ${COMMON_ARGS} ${COMMON_VSPEC_ARG} -o vss_rel_$$(cat VERSION).vspec
vspec export id ${COMMON_ARGS} ${COMMON_VSPEC_ARG} -o vss.vspec

clean:
rm -f vss_rel_*
rm -f vss.*
rm -rf apigear
rm -rf samm
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

35 changes: 35 additions & 0 deletions scripts/install_vss_tools.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/sh
#
# Change this script to specify which version of vss-tools to install.
# It must be a version compatible with the VSS version.
# See https://github.com/COVESA/vss-tools for vss-tools information
#
# To be able to run the script you must have a python/pip environment
# where pip is allowed, for instance a virtual python environment
# , see https://docs.python.org/3/library/venv.html
#
# ************ MASTER *************''
# For master (ongoing development) we typically rely on latest master of vss-tools
#
pip install git+https://github.com/COVESA/vss-tools@master

# Examples for other scenarios below
#
# ************ MAINTENANCE **********
# For development in maintenance branches we could either refer to a fixed version of vss-tools
# or refer to a maintenance branch of vss-tools
# pip install git+https://github.com/COVESA/[email protected]
#
#
# ************* RELEASE CANDIDATES AND OTHER PRE-RELEASES ***************
# For VSS release candidates we want to link to specified released VSS-tools version.
# Either a released version or a pre-release, referenced with "--pre"
# See https://pypi.org/project/vss-tools/
#
# pip install --pre vss-tools==5.0.0.dev0
#
#
# *********************** RELEASES ***************************
# For releases we should link to specific released pypi version.
#
# pip install vss-tools==4.2

0 comments on commit 1f4fa48

Please sign in to comment.