You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/04/21 04:11:29 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #757: Create release artifacts for release branches

xiaoxiang781216 commented on a change in pull request #757:
URL: https://github.com/apache/incubator-nuttx/pull/757#discussion_r411837618



##########
File path: .github/workflows/package.yml
##########
@@ -0,0 +1,58 @@
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+name: Release CI (package)

Review comment:
       Could we change name to Package? since other 

##########
File path: .github/workflows/package.yml
##########
@@ -0,0 +1,58 @@
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+name: Release CI (package)

Review comment:
       Could we change name to Package just like other action style(e.g. Check/Build/Doc)?

##########
File path: tools/gitver.sh
##########
@@ -0,0 +1,63 @@
+#!/bin/bash
+
+#****************************************************************************
+# tools/gitversion.sh
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+#****************************************************************************
+
+# Example usage:
+# $ ./gitver.sh 0.1
+#   0.1.2
+
+if [ $# -ne 1 ]
+then
+    echo "Missing version argument" 1>&2
+    exit -1
+fi 
+
+NUTTX_VERSION=$1
+
+# Closest Tag of this Version
+VER_TAG=`git describe --abbrev=0 --match "nuttx-$NUTTX_VERSION" --match "nuttx-$NUTTX_VERSION-*" --match "nuttx-$NUTTX_VERSION.[0-9]*"  2>/dev/null`
+if [ $? -ne 0 ]
+then
+    VER_TAG=nuttx-$NUTTX_VERSION
+fi
+
+
+# Remove nuttx and possible RC
+VER_TAG=`echo $VER_TAG | cut -d'-' --fields=2`
+
+# If version does not have a patch add one
+if [ `expr match $VER_TAG '.'` -eq 1 ]
+then
+    VER_TAG=${VER_TAG}.0
+fi
+
+SEMVER_REGEX="([0-9]+).([0-9]+).([0-9]+)"
+if [[ $VER_TAG =~ $SEMVER_REGEX ]]
+then
+    major="${BASH_REMATCH[1]}"
+    minor="${BASH_REMATCH[2]}"
+    patch="${BASH_REMATCH[3]}"
+else
+    echo "Unexpected Version format: $VER_TAG"  1>&2
+    exit -1
+fi
+
+echo ${major}.${minor}.${patch}

Review comment:
       Add a new line to remvoe the tail read mark?

##########
File path: tools/README.txt
##########
@@ -1137,3 +1137,22 @@ zipme.sh
         Same as above but use the key-id XXXXXX to sign the tarballs
       ./tools/zipme.sh -e "*.swp tmp" 9.0.0
         Create the tarballs but exclude any .swp file and the "tmp" directory.
+
+gitver.sh
+---------
+
+  This script will attempt to generate a semver version based on the git tags
+  and the supplied target version as either major.minor or major.minor.patch
+  If there is not yet a tag for Version 0.1 and 0.1 is supplied it will
+  return the version 0.1.0 If a tag exists of 0.1.2-RC1 it would return
+  version 0.1.2 to standard out if 0.1 or 0.1.2 is supplied.
+  
+  This is helpful for generating a version string for a release tarbal on a

Review comment:
       tarbal to tarball

##########
File path: tools/gitver.sh
##########
@@ -0,0 +1,63 @@
+#!/bin/bash
+
+#****************************************************************************
+# tools/gitversion.sh

Review comment:
       gitver.sh

##########
File path: tools/README.txt
##########
@@ -1137,3 +1137,22 @@ zipme.sh
         Same as above but use the key-id XXXXXX to sign the tarballs
       ./tools/zipme.sh -e "*.swp tmp" 9.0.0
         Create the tarballs but exclude any .swp file and the "tmp" directory.
+
+gitver.sh

Review comment:
       It seem that version.sh can generate the similar version info like gitver.sh, can we reuse version.sh?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org