Skip to content

Commit 9606d3e

Browse files
committed
Update package version to format like 6.1.0_abcdefg_20XX.MM.DD
1 parent ee41a73 commit 9606d3e

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

.github/workflows/bumpdevversion.yml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,29 @@ jobs:
1717
uses: actions/[email protected]
1818

1919
# 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
2121
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
2331
24-
# Change Github sha hash
25-
- name: Update git revision number
32+
# Change development package version
33+
- name: Update package version
2634
uses: mikefarah/[email protected]
2735
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+
uses: mikefarah/[email protected]
41+
with:
42+
cmd: "yq write --inplace recipe/meta.yaml 'source.git_rev' ${{ steps.git_rev_info.outputs.full_sha }}"
2943

3044
# Take a look at recipe/meta.yaml contents
3145
- name: Check meta.yaml contents

0 commit comments

Comments
 (0)