@@ -17,15 +17,29 @@ jobs:
17
17
18
18
19
19
# Get latest GMT sha hash from Github
20
- - name : Get git revision number
20
+ - name : Get latest git revision number, tag version and commit date
21
21
id : git_rev_info
22
- run : echo ::set-output name=sha::$(git ls-remote https://github.com/GenericMappingTools/gmt HEAD | cut -f 1)
22
+ run : |
23
+ # Get full SHA value (e.g. abcdefghijklmnopqrstuvwxyz12345678901234)
24
+ echo ::set-output name=full_sha::$(git ls-remote https://github.com/GenericMappingTools/gmt HEAD | cut -f 1)
25
+ # Get shortened SHA value (e.g abcdefg)
26
+ echo ::set-output name=short_sha::$(git ls-remote https://github.com/GenericMappingTools/gmt HEAD | cut -c 1-7)
27
+ # Get tag with highest version number (e.g. 1.2.3)
28
+ echo ::set-output name=latest_tag::$(git ls-remote -q --sort="-version:refname" --tags --refs https://github.com/GenericMappingTools/gmt | head -n 1 | cut -d / -f 3)
29
+ # Get date of latest commit
30
+ # TODO
23
31
24
- # Change Github sha hash
25
- - name : Update git revision number
32
+ # Change development package version
33
+ - name : Update package version
26
34
27
35
with :
28
- cmd : " yq write --inplace recipe/meta.yaml 'source.git_rev' ${{ steps.git_rev_info.outputs.sha }}"
36
+ cmd : " yq write --inplace recipe/meta.yaml 'package.version' ${{ steps.git_rev_info.outputs.latest_tag }}_${{ steps.git_rev_info.outputs.short_sha }}_20XX.MM.DD"
37
+
38
+ # Change
39
+ - name : Update package source's git revision
40
+
41
+ with :
42
+ cmd : " yq write --inplace recipe/meta.yaml 'source.git_rev' ${{ steps.git_rev_info.outputs.full_sha }}"
29
43
30
44
# Take a look at recipe/meta.yaml contents
31
45
- name : Check meta.yaml contents
0 commit comments